/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('aimiaobi', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddDatasetDocumentRequest {
  datasetId?: long(name='DatasetId', example='1'),
  datasetName?: string(name='DatasetName', example='数据集名称'),
  document?: {
    content?: string(name='Content', example='xxx'),
    disableHandleMultimodalMedia?: boolean(name='DisableHandleMultimodalMedia', example='false'),
    docId?: string(name='DocId', example='业务文档唯一ID'),
    docType?: string(name='DocType', example='文档类型'),
    docUuid?: string(name='DocUuid', example='内部文档唯一ID'),
    extend1?: string(name='Extend1', example='扩展字段1'),
    extend2?: string(name='Extend2', example='扩展字段2'),
    extend3?: string(name='Extend3', example='扩展字段3'),
    multimodalIndexName?: string(name='MultimodalIndexName', example='模型名称 todo 商业化 仅个别账号可传入'),
    multimodalMedias?: [ 
      {
        fileUrl?: string(name='FileUrl', example='图片或视频文件地址'),
        mediaId?: string(name='MediaId', example='多模态数据唯一标识'),
        mediaType?: string(name='MediaType', example='多模态数据类型'),
      }
    ](name='MultimodalMedias'),
    pubTime?: string(name='PubTime', example='2024-12-09 13:35:40'),
    sourceFrom?: string(name='SourceFrom', example='来源'),
    summary?: string(name='Summary', example='文章摘要'),
    title?: string(name='Title', example='xxxxx@xxxxx.com'),
    url?: string(name='Url', example='xxx'),
  }(name='Document', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xx'),
}

model AddDatasetDocumentShrinkRequest {
  datasetId?: long(name='DatasetId', example='1'),
  datasetName?: string(name='DatasetName', example='数据集名称'),
  documentShrink?: string(name='Document', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xx'),
}

model AddDatasetDocumentResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    docId?: string(name='DocId', example='文档业务唯一标识'),
    docUuid?: string(name='DocUuid', example='8df2d69d63a247b6b52ff455b2d426b6'),
    errorCode?: string(name='ErrorCode', example='Success'),
    errorMessage?: string(name='ErrorMessage'),
    status?: int32(name='Status', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model AddDatasetDocumentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddDatasetDocumentResponseBody(name='body'),
}

/**
 * @summary 添加文档到数据集
 *
 * @param tmpReq AddDatasetDocumentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddDatasetDocumentResponse
 */
async function addDatasetDocumentWithOptions(tmpReq: AddDatasetDocumentRequest, runtime: $RuntimeOptions): AddDatasetDocumentResponse {
  tmpReq.validate();
  var request = new AddDatasetDocumentShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.document)) {
    request.documentShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.document, 'Document', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!$isNull(request.datasetName)) {
    body['DatasetName'] = request.datasetName;
  }
  if (!$isNull(request.documentShrink)) {
    body['Document'] = request.documentShrink;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddDatasetDocument',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 添加文档到数据集
 *
 * @param request AddDatasetDocumentRequest
 * @return AddDatasetDocumentResponse
 */
async function addDatasetDocument(request: AddDatasetDocumentRequest): AddDatasetDocumentResponse {
  var runtime = new $RuntimeOptions{};
  return addDatasetDocumentWithOptions(request, runtime);
}

model CancelAsyncTaskRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
  taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model CancelAsyncTaskResponseBody = {
  code?: string(name='Code', example='200'),
  data?: boolean(name='Data', example='true'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Success'),
  requestId?: string(name='RequestId', example='FB698445-61DA-5361-BF73-1C5F1157E888'),
  success?: boolean(name='Success', example='True'),
}

model CancelAsyncTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelAsyncTaskResponseBody(name='body'),
}

/**
 * @summary 取消异步任务
 *
 * @param request CancelAsyncTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelAsyncTaskResponse
 */
async function cancelAsyncTaskWithOptions(request: CancelAsyncTaskRequest, runtime: $RuntimeOptions): CancelAsyncTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelAsyncTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 取消异步任务
 *
 * @param request CancelAsyncTaskRequest
 * @return CancelAsyncTaskResponse
 */
async function cancelAsyncTask(request: CancelAsyncTaskRequest): CancelAsyncTaskResponse {
  var runtime = new $RuntimeOptions{};
  return cancelAsyncTaskWithOptions(request, runtime);
}

model ClearIntervenesRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
}

model ClearIntervenesResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    failIdList?: [ string ](name='FailIdList'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model ClearIntervenesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ClearIntervenesResponseBody(name='body'),
}

/**
 * @summary 清除所有干预内容
 *
 * @param request ClearIntervenesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ClearIntervenesResponse
 */
async function clearIntervenesWithOptions(request: ClearIntervenesRequest, runtime: $RuntimeOptions): ClearIntervenesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ClearIntervenes',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 清除所有干预内容
 *
 * @param request ClearIntervenesRequest
 * @return ClearIntervenesResponse
 */
async function clearIntervenes(request: ClearIntervenesRequest): ClearIntervenesResponse {
  var runtime = new $RuntimeOptions{};
  return clearIntervenesWithOptions(request, runtime);
}

model CreateDatasetRequest {
  datasetConfig?: {
    searchSourceConfigs?: [ 
      {
        demoQuery?: string(name='DemoQuery', example='可以搜索到的关键词，用来验证是否可用'),
        searchSourceRequestConfig?: {
          body?: string(name='Body', example='{}'),
          connectTimeout?: int32(name='ConnectTimeout', example='3000'),
          headers?: [ 
            {
              name?: string(name='Name', example='参数名称'),
              value?: string(name='Value', example='参数值'),
              valueFormat?: string(name='ValueFormat', example='valueType = time 时有效'),
              valueType?: string(name='ValueType', example='参数值数据类型: 默认string'),
            }
          ](name='Headers'),
          method?: string(name='Method', example='请求方式'),
          params?: [ 
            {
              name?: string(name='Name', example='参数名称'),
              value?: string(name='Value', example='参数值'),
              valueFormat?: string(name='ValueFormat', example='valueType = time 时有效'),
              valueType?: string(name='ValueType', example='参数值数据类型: 默认string'),
            }
          ](name='Params'),
          pathParamsEnable?: boolean(name='PathParamsEnable', example='true'),
          socketTimeout?: int32(name='SocketTimeout', example='3000'),
          url?: string(name='Url', example='api地址'),
        }(name='SearchSourceRequestConfig'),
        searchSourceResponseConfig?: {
          jqNodes?: [ 
            {
              jqNodes?: [ 
                {
                  jqNodes?: [ 
                    {
                      key?: string(name='Key', example='title'),
                      path?: string(name='Path'),
                      type?: string(name='Type', example='string'),
                    }
                  ](name='JqNodes'),
                  key?: string(name='Key', example='title'),
                  path?: string(name='Path'),
                  type?: string(name='Type', example='string'),
                }
              ](name='JqNodes'),
              key?: string(name='Key', example='节点key'),
              path?: string(name='Path', example='节点路径'),
              type?: string(name='Type', example='节点数据类型：string number list object base'),
            }
          ](name='JqNodes'),
        }(name='SearchSourceResponseConfig'),
        size?: int32(name='Size', example='10'),
      }
    ](name='SearchSourceConfigs'),
  }(name='DatasetConfig'),
  datasetDescription?: string(name='DatasetDescription', example='企业自定义数据集'),
  datasetName?: string(name='DatasetName', description='This parameter is required.', example='businessDataset'),
  datasetType?: string(name='DatasetType', example='CustomSemanticSearch'),
  documentHandleConfig?: {
    disableHandleMultimodalMedia?: boolean(name='DisableHandleMultimodalMedia', example='false'),
  }(name='DocumentHandleConfig'),
  invokeType?: string(name='InvokeType', example='portal'),
  searchDatasetEnable?: int32(name='SearchDatasetEnable', example='3'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model CreateDatasetShrinkRequest {
  datasetConfigShrink?: string(name='DatasetConfig'),
  datasetDescription?: string(name='DatasetDescription', example='企业自定义数据集'),
  datasetName?: string(name='DatasetName', description='This parameter is required.', example='businessDataset'),
  datasetType?: string(name='DatasetType', example='CustomSemanticSearch'),
  documentHandleConfigShrink?: string(name='DocumentHandleConfig'),
  invokeType?: string(name='InvokeType', example='portal'),
  searchDatasetEnable?: int32(name='SearchDatasetEnable', example='3'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model CreateDatasetResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    createTime?: string(name='CreateTime', example='2024-11-12 21:46:24'),
    createUser?: string(name='CreateUser', example='xxx'),
    datasetDescription?: string(name='DatasetDescription', example='xxx'),
    datasetId?: long(name='DatasetId', example='1'),
    datasetName?: string(name='DatasetName', example='xxx'),
    datasetType?: string(name='DatasetType', example='CustomSemanticSearch'),
    searchDatasetEnable?: int32(name='SearchDatasetEnable', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model CreateDatasetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDatasetResponseBody(name='body'),
}

/**
 * @summary 数据集管理-创建
 *
 * @param tmpReq CreateDatasetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDatasetResponse
 */
async function createDatasetWithOptions(tmpReq: CreateDatasetRequest, runtime: $RuntimeOptions): CreateDatasetResponse {
  tmpReq.validate();
  var request = new CreateDatasetShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.datasetConfig)) {
    request.datasetConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.datasetConfig, 'DatasetConfig', 'json');
  }
  if (!$isNull(tmpReq.documentHandleConfig)) {
    request.documentHandleConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.documentHandleConfig, 'DocumentHandleConfig', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.datasetConfigShrink)) {
    body['DatasetConfig'] = request.datasetConfigShrink;
  }
  if (!$isNull(request.datasetDescription)) {
    body['DatasetDescription'] = request.datasetDescription;
  }
  if (!$isNull(request.datasetName)) {
    body['DatasetName'] = request.datasetName;
  }
  if (!$isNull(request.datasetType)) {
    body['DatasetType'] = request.datasetType;
  }
  if (!$isNull(request.documentHandleConfigShrink)) {
    body['DocumentHandleConfig'] = request.documentHandleConfigShrink;
  }
  if (!$isNull(request.invokeType)) {
    body['InvokeType'] = request.invokeType;
  }
  if (!$isNull(request.searchDatasetEnable)) {
    body['SearchDatasetEnable'] = request.searchDatasetEnable;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateDataset',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 数据集管理-创建
 *
 * @param request CreateDatasetRequest
 * @return CreateDatasetResponse
 */
async function createDataset(request: CreateDatasetRequest): CreateDatasetResponse {
  var runtime = new $RuntimeOptions{};
  return createDatasetWithOptions(request, runtime);
}

model CreateGeneratedContentRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxx_efm'),
  content?: string(name='Content', description='This parameter is required.'),
  contentDomain?: string(name='ContentDomain', example='government'),
  contentText?: string(name='ContentText'),
  keywords?: [ string ](name='Keywords'),
  prompt?: string(name='Prompt'),
  taskId?: string(name='TaskId', description='This parameter is required.', example='xxx'),
  title?: string(name='Title', description='This parameter is required.'),
  uuid?: string(name='Uuid', example='xxxx'),
}

model CreateGeneratedContentShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxx_efm'),
  content?: string(name='Content', description='This parameter is required.'),
  contentDomain?: string(name='ContentDomain', example='government'),
  contentText?: string(name='ContentText'),
  keywordsShrink?: string(name='Keywords'),
  prompt?: string(name='Prompt'),
  taskId?: string(name='TaskId', description='This parameter is required.', example='xxx'),
  title?: string(name='Title', description='This parameter is required.'),
  uuid?: string(name='Uuid', example='xxxx'),
}

model CreateGeneratedContentResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  data?: long(name='Data', example='42'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='数据不存在'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='false'),
}

model CreateGeneratedContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateGeneratedContentResponseBody(name='body'),
}

/**
 * @summary 文档管理-创建
 *
 * @param tmpReq CreateGeneratedContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateGeneratedContentResponse
 */
async function createGeneratedContentWithOptions(tmpReq: CreateGeneratedContentRequest, runtime: $RuntimeOptions): CreateGeneratedContentResponse {
  tmpReq.validate();
  var request = new CreateGeneratedContentShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.keywords)) {
    request.keywordsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.keywords, 'Keywords', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.content)) {
    body['Content'] = request.content;
  }
  if (!$isNull(request.contentDomain)) {
    body['ContentDomain'] = request.contentDomain;
  }
  if (!$isNull(request.contentText)) {
    body['ContentText'] = request.contentText;
  }
  if (!$isNull(request.keywordsShrink)) {
    body['Keywords'] = request.keywordsShrink;
  }
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.title)) {
    body['Title'] = request.title;
  }
  if (!$isNull(request.uuid)) {
    body['Uuid'] = request.uuid;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateGeneratedContent',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档管理-创建
 *
 * @param request CreateGeneratedContentRequest
 * @return CreateGeneratedContentResponse
 */
async function createGeneratedContent(request: CreateGeneratedContentRequest): CreateGeneratedContentResponse {
  var runtime = new $RuntimeOptions{};
  return createGeneratedContentWithOptions(request, runtime);
}

model CreateTokenRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='2daaa2e0c209xb26acb97009ea77bd4b_p_efm'),
}

model CreateTokenResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    expiredTime?: long(name='ExpiredTime', example='1705388704855'),
    token?: string(name='Token', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model CreateTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTokenResponseBody(name='body'),
}

/**
 * @summary 获取授权token
 *
 * @param request CreateTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTokenResponse
 */
async function createTokenWithOptions(request: CreateTokenRequest, runtime: $RuntimeOptions): CreateTokenResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateToken',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取授权token
 *
 * @param request CreateTokenRequest
 * @return CreateTokenResponse
 */
async function createToken(request: CreateTokenRequest): CreateTokenResponse {
  var runtime = new $RuntimeOptions{};
  return createTokenWithOptions(request, runtime);
}

model DeleteCustomTextRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  commodityCode?: string(name='CommodityCode'),
  id?: long(name='Id', description='This parameter is required.', example='85'),
}

model DeleteCustomTextResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: boolean(name='Data', example='false'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model DeleteCustomTextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCustomTextResponseBody(name='body'),
}

/**
 * @summary 删除自定义文本
 *
 * @param request DeleteCustomTextRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCustomTextResponse
 */
async function deleteCustomTextWithOptions(request: DeleteCustomTextRequest, runtime: $RuntimeOptions): DeleteCustomTextResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.commodityCode)) {
    body['CommodityCode'] = request.commodityCode;
  }
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteCustomText',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除自定义文本
 *
 * @param request DeleteCustomTextRequest
 * @return DeleteCustomTextResponse
 */
async function deleteCustomText(request: DeleteCustomTextRequest): DeleteCustomTextResponse {
  var runtime = new $RuntimeOptions{};
  return deleteCustomTextWithOptions(request, runtime);
}

model DeleteCustomTopicByTopicRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  topic?: string(name='Topic', description='This parameter is required.', example='话题'),
}

model DeleteCustomTopicByTopicResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: int32(name='Data', example='33'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model DeleteCustomTopicByTopicResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCustomTopicByTopicResponseBody(name='body'),
}

/**
 * @summary 根据主题删除自定义主题事件
 *
 * @param request DeleteCustomTopicByTopicRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCustomTopicByTopicResponse
 */
async function deleteCustomTopicByTopicWithOptions(request: DeleteCustomTopicByTopicRequest, runtime: $RuntimeOptions): DeleteCustomTopicByTopicResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteCustomTopicByTopic',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据主题删除自定义主题事件
 *
 * @param request DeleteCustomTopicByTopicRequest
 * @return DeleteCustomTopicByTopicResponse
 */
async function deleteCustomTopicByTopic(request: DeleteCustomTopicByTopicRequest): DeleteCustomTopicByTopicResponse {
  var runtime = new $RuntimeOptions{};
  return deleteCustomTopicByTopicWithOptions(request, runtime);
}

model DeleteCustomTopicViewPointByIdRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  customViewPointId?: string(name='CustomViewPointId', description='This parameter is required.', example='dfd73894e6a94fd79fe7ffbe865796fb'),
}

model DeleteCustomTopicViewPointByIdResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: int32(name='Data', example='7'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model DeleteCustomTopicViewPointByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCustomTopicViewPointByIdResponseBody(name='body'),
}

/**
 * @summary 根据自定义观点ID删除自定义观点
 *
 * @param request DeleteCustomTopicViewPointByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCustomTopicViewPointByIdResponse
 */
async function deleteCustomTopicViewPointByIdWithOptions(request: DeleteCustomTopicViewPointByIdRequest, runtime: $RuntimeOptions): DeleteCustomTopicViewPointByIdResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.customViewPointId)) {
    body['CustomViewPointId'] = request.customViewPointId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteCustomTopicViewPointById',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据自定义观点ID删除自定义观点
 *
 * @param request DeleteCustomTopicViewPointByIdRequest
 * @return DeleteCustomTopicViewPointByIdResponse
 */
async function deleteCustomTopicViewPointById(request: DeleteCustomTopicViewPointByIdRequest): DeleteCustomTopicViewPointByIdResponse {
  var runtime = new $RuntimeOptions{};
  return deleteCustomTopicViewPointByIdWithOptions(request, runtime);
}

model DeleteDatasetRequest {
  datasetId?: long(name='DatasetId', description='This parameter is required.', example='1'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model DeleteDatasetResponseBody = {
  code?: string(name='Code', example='NoData'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model DeleteDatasetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDatasetResponseBody(name='body'),
}

/**
 * @summary 数据集管理-删除
 *
 * @param request DeleteDatasetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDatasetResponse
 */
async function deleteDatasetWithOptions(request: DeleteDatasetRequest, runtime: $RuntimeOptions): DeleteDatasetResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteDataset',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 数据集管理-删除
 *
 * @param request DeleteDatasetRequest
 * @return DeleteDatasetResponse
 */
async function deleteDataset(request: DeleteDatasetRequest): DeleteDatasetResponse {
  var runtime = new $RuntimeOptions{};
  return deleteDatasetWithOptions(request, runtime);
}

model DeleteDatasetDocumentRequest {
  datasetId?: long(name='DatasetId', example='1'),
  datasetName?: string(name='DatasetName', example='数据集名称'),
  docId?: string(name='DocId', example='xxx'),
  docUuid?: string(name='DocUuid', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xx'),
}

model DeleteDatasetDocumentResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ string ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model DeleteDatasetDocumentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDatasetDocumentResponseBody(name='body'),
}

/**
 * @summary 删除数据集文档
 *
 * @param request DeleteDatasetDocumentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDatasetDocumentResponse
 */
async function deleteDatasetDocumentWithOptions(request: DeleteDatasetDocumentRequest, runtime: $RuntimeOptions): DeleteDatasetDocumentResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!$isNull(request.datasetName)) {
    body['DatasetName'] = request.datasetName;
  }
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.docUuid)) {
    body['DocUuid'] = request.docUuid;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteDatasetDocument',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除数据集文档
 *
 * @param request DeleteDatasetDocumentRequest
 * @return DeleteDatasetDocumentResponse
 */
async function deleteDatasetDocument(request: DeleteDatasetDocumentRequest): DeleteDatasetDocumentResponse {
  var runtime = new $RuntimeOptions{};
  return deleteDatasetDocumentWithOptions(request, runtime);
}

model DeleteDocsRequest {
  docIds?: [ string ](name='DocIds', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model DeleteDocsShrinkRequest {
  docIdsShrink?: string(name='DocIds', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model DeleteDocsResponseBody = {
  code?: string(name='Code', example='successful'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='2C565EDD-E624-5FED-8565-0A9CB0C8CC46'),
  success?: boolean(name='Success', example='true'),
}

model DeleteDocsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDocsResponseBody(name='body'),
}

/**
 * @summary 妙读删除多个文档
 *
 * @param tmpReq DeleteDocsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDocsResponse
 */
async function deleteDocsWithOptions(tmpReq: DeleteDocsRequest, runtime: $RuntimeOptions): DeleteDocsResponse {
  tmpReq.validate();
  var request = new DeleteDocsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.docIds)) {
    request.docIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.docIds, 'DocIds', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.docIdsShrink)) {
    body['DocIds'] = request.docIdsShrink;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteDocs',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读删除多个文档
 *
 * @param request DeleteDocsRequest
 * @return DeleteDocsResponse
 */
async function deleteDocs(request: DeleteDocsRequest): DeleteDocsResponse {
  var runtime = new $RuntimeOptions{};
  return deleteDocsWithOptions(request, runtime);
}

model DeleteGeneratedContentRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  id?: long(name='Id', description='This parameter is required.', example='99'),
  regionId?: string(name='RegionId'),
}

model DeleteGeneratedContentResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  data?: boolean(name='Data', example='true'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='true'),
}

model DeleteGeneratedContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteGeneratedContentResponseBody(name='body'),
}

/**
 * @summary 文档管理-删除。
 *
 * @param request DeleteGeneratedContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteGeneratedContentResponse
 */
async function deleteGeneratedContentWithOptions(request: DeleteGeneratedContentRequest, runtime: $RuntimeOptions): DeleteGeneratedContentResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteGeneratedContent',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档管理-删除。
 *
 * @param request DeleteGeneratedContentRequest
 * @return DeleteGeneratedContentResponse
 */
async function deleteGeneratedContent(request: DeleteGeneratedContentRequest): DeleteGeneratedContentResponse {
  var runtime = new $RuntimeOptions{};
  return deleteGeneratedContentWithOptions(request, runtime);
}

model DeleteInterveneRuleRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  ruleId?: long(name='RuleId', example='12345'),
}

model DeleteInterveneRuleResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    failIdList?: [ string ](name='FailIdList'),
    taskId?: string(name='TaskId', example='dt-s50ntwtywb4y'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='94512A33-8EC1-5452-A793-5C91F18ED2F0'),
  success?: boolean(name='Success', example='true'),
}

model DeleteInterveneRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteInterveneRuleResponseBody(name='body'),
}

/**
 * @summary 删除干预规则
 *
 * @param request DeleteInterveneRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteInterveneRuleResponse
 */
async function deleteInterveneRuleWithOptions(request: DeleteInterveneRuleRequest, runtime: $RuntimeOptions): DeleteInterveneRuleResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.ruleId)) {
    body['RuleId'] = request.ruleId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteInterveneRule',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除干预规则
 *
 * @param request DeleteInterveneRuleRequest
 * @return DeleteInterveneRuleResponse
 */
async function deleteInterveneRule(request: DeleteInterveneRuleRequest): DeleteInterveneRuleResponse {
  var runtime = new $RuntimeOptions{};
  return deleteInterveneRuleWithOptions(request, runtime);
}

model DeleteMaterialByIdRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='cd327c3d5d5e44159cc716e23bfa530e_p_beebot_public'),
  id?: long(name='Id', description='This parameter is required.', example='10'),
}

model DeleteMaterialByIdResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  data?: boolean(name='Data', example='false'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='数据不存在'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='false'),
}

model DeleteMaterialByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMaterialByIdResponseBody(name='body'),
}

/**
 * @summary 根据ID删除素材
 *
 * @param request DeleteMaterialByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMaterialByIdResponse
 */
async function deleteMaterialByIdWithOptions(request: DeleteMaterialByIdRequest, runtime: $RuntimeOptions): DeleteMaterialByIdResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteMaterialById',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据ID删除素材
 *
 * @param request DeleteMaterialByIdRequest
 * @return DeleteMaterialByIdResponse
 */
async function deleteMaterialById(request: DeleteMaterialByIdRequest): DeleteMaterialByIdResponse {
  var runtime = new $RuntimeOptions{};
  return deleteMaterialByIdWithOptions(request, runtime);
}

model DocumentExtractionRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  urls?: [ string ](name='Urls', description='This parameter is required.'),
}

model DocumentExtractionShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  urlsShrink?: string(name='Urls', description='This parameter is required.'),
}

model DocumentExtractionResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      author?: string(name='Author', example='作者'),
      content?: string(name='Content', example='文章内容'),
      docId?: string(name='DocId', example='文档-自定义的唯一ID'),
      docUuid?: string(name='DocUuid', example='8df2d69d63a247b6b52ff455b2d426b6'),
      pubTime?: string(name='PubTime', example='2024-05-14 08:54:33'),
      source?: string(name='Source', example='央视网'),
      summary?: string(name='Summary', example='文章摘要'),
      tag?: string(name='Tag', example='文章标签'),
      title?: string(name='Title', example='文章标题'),
      url?: string(name='Url', example='https://www.example.com/aaa.docx'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model DocumentExtractionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DocumentExtractionResponseBody(name='body'),
}

/**
 * @summary 从链接中提取文档内容
 *
 * @param tmpReq DocumentExtractionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DocumentExtractionResponse
 */
async function documentExtractionWithOptions(tmpReq: DocumentExtractionRequest, runtime: $RuntimeOptions): DocumentExtractionResponse {
  tmpReq.validate();
  var request = new DocumentExtractionShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.urls)) {
    request.urlsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.urls, 'Urls', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.urlsShrink)) {
    body['Urls'] = request.urlsShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DocumentExtraction',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 从链接中提取文档内容
 *
 * @param request DocumentExtractionRequest
 * @return DocumentExtractionResponse
 */
async function documentExtraction(request: DocumentExtractionRequest): DocumentExtractionResponse {
  var runtime = new $RuntimeOptions{};
  return documentExtractionWithOptions(request, runtime);
}

model ExportAnalysisTagDetailByTaskIdRequest {
  categories?: [ string ](name='Categories'),
  taskId?: string(name='TaskId', description='This parameter is required.', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model ExportAnalysisTagDetailByTaskIdShrinkRequest {
  categoriesShrink?: string(name='Categories'),
  taskId?: string(name='TaskId', description='This parameter is required.', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model ExportAnalysisTagDetailByTaskIdResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: string(name='Data', example='http://www.example.com/xxx.xlsx'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model ExportAnalysisTagDetailByTaskIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportAnalysisTagDetailByTaskIdResponseBody(name='body'),
}

/**
 * @summary 导出企业VOC分析任务明细列表
 *
 * @param tmpReq ExportAnalysisTagDetailByTaskIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportAnalysisTagDetailByTaskIdResponse
 */
async function exportAnalysisTagDetailByTaskIdWithOptions(tmpReq: ExportAnalysisTagDetailByTaskIdRequest, runtime: $RuntimeOptions): ExportAnalysisTagDetailByTaskIdResponse {
  tmpReq.validate();
  var request = new ExportAnalysisTagDetailByTaskIdShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.categories)) {
    request.categoriesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.categories, 'Categories', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.categoriesShrink)) {
    body['Categories'] = request.categoriesShrink;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ExportAnalysisTagDetailByTaskId',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 导出企业VOC分析任务明细列表
 *
 * @param request ExportAnalysisTagDetailByTaskIdRequest
 * @return ExportAnalysisTagDetailByTaskIdResponse
 */
async function exportAnalysisTagDetailByTaskId(request: ExportAnalysisTagDetailByTaskIdRequest): ExportAnalysisTagDetailByTaskIdResponse {
  var runtime = new $RuntimeOptions{};
  return exportAnalysisTagDetailByTaskIdWithOptions(request, runtime);
}

model ExportGeneratedContentRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  id?: long(name='Id', description='This parameter is required.', example='1'),
}

model ExportGeneratedContentResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: string(name='Data', example='xxx'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model ExportGeneratedContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportGeneratedContentResponseBody(name='body'),
}

/**
 * @summary 文档管理-导出。
 *
 * @param request ExportGeneratedContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportGeneratedContentResponse
 */
async function exportGeneratedContentWithOptions(request: ExportGeneratedContentRequest, runtime: $RuntimeOptions): ExportGeneratedContentResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ExportGeneratedContent',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档管理-导出。
 *
 * @param request ExportGeneratedContentRequest
 * @return ExportGeneratedContentResponse
 */
async function exportGeneratedContent(request: ExportGeneratedContentRequest): ExportGeneratedContentResponse {
  var runtime = new $RuntimeOptions{};
  return exportGeneratedContentWithOptions(request, runtime);
}

model ExportHotTopicPlanningProposalsRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  customViewPointIds?: [ string ](name='CustomViewPointIds', example='025c6cee437741368098b790c90166f8'),
  exportType?: string(name='ExportType', example='导出文档类型，word:导出为word,xmind:导处为xmind'),
  titles?: [ string ](name='Titles'),
  topic?: string(name='Topic', description='This parameter is required.', example='热榜主题'),
  topicSource?: string(name='TopicSource', description='This parameter is required.', example='热榜源'),
  viewPointType?: string(name='ViewPointType', example='选题策划类型：CustomViewPoints:自定义视角，HotViewPoints:热门视角、TimedViewPoints:时效性视角、WebReviewPoints:网友视角、FreshViewPoints:新颖视角'),
}

model ExportHotTopicPlanningProposalsShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  customViewPointIdsShrink?: string(name='CustomViewPointIds', example='025c6cee437741368098b790c90166f8'),
  exportType?: string(name='ExportType', example='导出文档类型，word:导出为word,xmind:导处为xmind'),
  titlesShrink?: string(name='Titles'),
  topic?: string(name='Topic', description='This parameter is required.', example='热榜主题'),
  topicSource?: string(name='TopicSource', description='This parameter is required.', example='热榜源'),
  viewPointType?: string(name='ViewPointType', example='选题策划类型：CustomViewPoints:自定义视角，HotViewPoints:热门视角、TimedViewPoints:时效性视角、WebReviewPoints:网友视角、FreshViewPoints:新颖视角'),
}

model ExportHotTopicPlanningProposalsResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: string(name='Data', example='业务数据'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model ExportHotTopicPlanningProposalsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportHotTopicPlanningProposalsResponseBody(name='body'),
}

/**
 * @summary 导出选题策划文档，响应为一个可公开访问的URL。一小时后失效
 *
 * @param tmpReq ExportHotTopicPlanningProposalsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportHotTopicPlanningProposalsResponse
 */
async function exportHotTopicPlanningProposalsWithOptions(tmpReq: ExportHotTopicPlanningProposalsRequest, runtime: $RuntimeOptions): ExportHotTopicPlanningProposalsResponse {
  tmpReq.validate();
  var request = new ExportHotTopicPlanningProposalsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.customViewPointIds)) {
    request.customViewPointIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.customViewPointIds, 'CustomViewPointIds', 'json');
  }
  if (!$isNull(tmpReq.titles)) {
    request.titlesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.titles, 'Titles', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.customViewPointIdsShrink)) {
    body['CustomViewPointIds'] = request.customViewPointIdsShrink;
  }
  if (!$isNull(request.exportType)) {
    body['ExportType'] = request.exportType;
  }
  if (!$isNull(request.titlesShrink)) {
    body['Titles'] = request.titlesShrink;
  }
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  if (!$isNull(request.topicSource)) {
    body['TopicSource'] = request.topicSource;
  }
  if (!$isNull(request.viewPointType)) {
    body['ViewPointType'] = request.viewPointType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ExportHotTopicPlanningProposals',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 导出选题策划文档，响应为一个可公开访问的URL。一小时后失效
 *
 * @param request ExportHotTopicPlanningProposalsRequest
 * @return ExportHotTopicPlanningProposalsResponse
 */
async function exportHotTopicPlanningProposals(request: ExportHotTopicPlanningProposalsRequest): ExportHotTopicPlanningProposalsResponse {
  var runtime = new $RuntimeOptions{};
  return exportHotTopicPlanningProposalsWithOptions(request, runtime);
}

model ExportIntervenesRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='fed6555ec9e24b92aeecc34be484b887_p_efm'),
}

model ExportIntervenesResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    fileUrl?: string(name='FileUrl', example='http://xxx/xxx.xls'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model ExportIntervenesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportIntervenesResponseBody(name='body'),
}

/**
 * @summary 导出所有干预内容
 *
 * @param request ExportIntervenesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportIntervenesResponse
 */
async function exportIntervenesWithOptions(request: ExportIntervenesRequest, runtime: $RuntimeOptions): ExportIntervenesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ExportIntervenes',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 导出所有干预内容
 *
 * @param request ExportIntervenesRequest
 * @return ExportIntervenesResponse
 */
async function exportIntervenes(request: ExportIntervenesRequest): ExportIntervenesResponse {
  var runtime = new $RuntimeOptions{};
  return exportIntervenesWithOptions(request, runtime);
}

model FeedbackDialogueRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='fcb14f25c9ee41ccad33a049de8f941b_p_outbound_public'),
  customerResponse?: string(name='CustomerResponse', example='test'),
  goodText?: string(name='GoodText', example='test'),
  modifiedResponse?: string(name='ModifiedResponse', example='test'),
  rating?: string(name='Rating', example='thumbsDown'),
  ratingTags?: [ string ](name='RatingTags'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='75bf82fa-b71b-45d7-ae40-0b00e496cd9e'),
  taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model FeedbackDialogueShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='fcb14f25c9ee41ccad33a049de8f941b_p_outbound_public'),
  customerResponse?: string(name='CustomerResponse', example='test'),
  goodText?: string(name='GoodText', example='test'),
  modifiedResponse?: string(name='ModifiedResponse', example='test'),
  rating?: string(name='Rating', example='thumbsDown'),
  ratingTagsShrink?: string(name='RatingTags'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='75bf82fa-b71b-45d7-ae40-0b00e496cd9e'),
  taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model FeedbackDialogueResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='数据不存在'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='false'),
}

model FeedbackDialogueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FeedbackDialogueResponseBody(name='body'),
}

/**
 * @summary 反馈某次生成的结果
 *
 * @param tmpReq FeedbackDialogueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FeedbackDialogueResponse
 */
async function feedbackDialogueWithOptions(tmpReq: FeedbackDialogueRequest, runtime: $RuntimeOptions): FeedbackDialogueResponse {
  tmpReq.validate();
  var request = new FeedbackDialogueShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.ratingTags)) {
    request.ratingTagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.ratingTags, 'RatingTags', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.customerResponse)) {
    body['CustomerResponse'] = request.customerResponse;
  }
  if (!$isNull(request.goodText)) {
    body['GoodText'] = request.goodText;
  }
  if (!$isNull(request.modifiedResponse)) {
    body['ModifiedResponse'] = request.modifiedResponse;
  }
  if (!$isNull(request.rating)) {
    body['Rating'] = request.rating;
  }
  if (!$isNull(request.ratingTagsShrink)) {
    body['RatingTags'] = request.ratingTagsShrink;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'FeedbackDialogue',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 反馈某次生成的结果
 *
 * @param request FeedbackDialogueRequest
 * @return FeedbackDialogueResponse
 */
async function feedbackDialogue(request: FeedbackDialogueRequest): FeedbackDialogueResponse {
  var runtime = new $RuntimeOptions{};
  return feedbackDialogueWithOptions(request, runtime);
}

model FetchImageTaskRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='cd327c3d5d5e44159cc716e23bfa530e_p_beebot_public'),
  articleTaskId?: string(name='ArticleTaskId', description='This parameter is required.', example='e1be065b-adc3-435e-bd01-1c18c5ed75d3'),
  taskIdList?: [ string ](name='TaskIdList', description='This parameter is required.', example='["9d8c9185-3f75-4a20-aca1-c5bb53dd97b3"]'),
}

model FetchImageTaskShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='cd327c3d5d5e44159cc716e23bfa530e_p_beebot_public'),
  articleTaskId?: string(name='ArticleTaskId', description='This parameter is required.', example='e1be065b-adc3-435e-bd01-1c18c5ed75d3'),
  taskIdListShrink?: string(name='TaskIdList', description='This parameter is required.', example='["9d8c9185-3f75-4a20-aca1-c5bb53dd97b3"]'),
}

model FetchImageTaskResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    taskInfoList?: [ 
      {
        id?: long(name='Id', example='1'),
        imageList?: [ 
          {
            code?: string(name='Code', example='NoData'),
            message?: string(name='Message'),
            url?: string(name='Url', example='http://www.example.com/xxx.png'),
          }
        ](name='ImageList'),
        taskId?: string(name='TaskId', example='net-7eb32699000d4193a3c59fc64ae1e55f'),
        taskStatus?: string(name='TaskStatus', example='SUCCESSED'),
      }
    ](name='TaskInfoList'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='DD656AF9-0839-521A-A3D2-F320009F9C87'),
  success?: boolean(name='Success', example='true'),
}

model FetchImageTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FetchImageTaskResponseBody(name='body'),
}

/**
 * @summary 获取图片任务执行结果
 *
 * @param tmpReq FetchImageTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FetchImageTaskResponse
 */
async function fetchImageTaskWithOptions(tmpReq: FetchImageTaskRequest, runtime: $RuntimeOptions): FetchImageTaskResponse {
  tmpReq.validate();
  var request = new FetchImageTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.taskIdList)) {
    request.taskIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.taskIdList, 'TaskIdList', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.articleTaskId)) {
    body['ArticleTaskId'] = request.articleTaskId;
  }
  if (!$isNull(request.taskIdListShrink)) {
    body['TaskIdList'] = request.taskIdListShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'FetchImageTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取图片任务执行结果
 *
 * @param request FetchImageTaskRequest
 * @return FetchImageTaskResponse
 */
async function fetchImageTask(request: FetchImageTaskRequest): FetchImageTaskResponse {
  var runtime = new $RuntimeOptions{};
  return fetchImageTaskWithOptions(request, runtime);
}

model GenerateFileUrlByKeyRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  fileKey?: string(name='FileKey', example='oss://default/oss-bucket-name/aimiaobi/2021/07/01/1625126400000/1.docx'),
  fileName?: string(name='FileName'),
}

model GenerateFileUrlByKeyResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: string(name='Data', example='https://www.example.com/a.txt'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GenerateFileUrlByKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateFileUrlByKeyResponseBody(name='body'),
}

/**
 * @summary 生成临时可访问的公开url
 *
 * @param request GenerateFileUrlByKeyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateFileUrlByKeyResponse
 */
async function generateFileUrlByKeyWithOptions(request: GenerateFileUrlByKeyRequest, runtime: $RuntimeOptions): GenerateFileUrlByKeyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.fileKey)) {
    body['FileKey'] = request.fileKey;
  }
  if (!$isNull(request.fileName)) {
    body['FileName'] = request.fileName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GenerateFileUrlByKey',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 生成临时可访问的公开url
 *
 * @param request GenerateFileUrlByKeyRequest
 * @return GenerateFileUrlByKeyResponse
 */
async function generateFileUrlByKey(request: GenerateFileUrlByKeyRequest): GenerateFileUrlByKeyResponse {
  var runtime = new $RuntimeOptions{};
  return generateFileUrlByKeyWithOptions(request, runtime);
}

model GenerateImageTaskRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='e1be065b-adc3-435e-bd01-1c18c5ed75d3'),
  articleTaskId?: string(name='ArticleTaskId', description='This parameter is required.', example='e1be065b-adc3-435e-bd01-1c18c5ed75d3'),
  paragraphList?: [ 
    {
      content?: string(name='Content', description='This parameter is required.', example='一直忧伤的猫'),
      id?: long(name='Id', description='This parameter is required.', example='1'),
      taskId?: string(name='TaskId', example='e1be065b-adc3-435e-bd01-1c18c5ed75d3'),
      taskStatus?: string(name='TaskStatus', example='SUCCESSED'),
    }
  ](name='ParagraphList', description='This parameter is required.'),
  size?: string(name='Size', description='This parameter is required.', example='1024*1024'),
  style?: string(name='Style', description='This parameter is required.', example='<auto>'),
}

model GenerateImageTaskShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='e1be065b-adc3-435e-bd01-1c18c5ed75d3'),
  articleTaskId?: string(name='ArticleTaskId', description='This parameter is required.', example='e1be065b-adc3-435e-bd01-1c18c5ed75d3'),
  paragraphListShrink?: string(name='ParagraphList', description='This parameter is required.'),
  size?: string(name='Size', description='This parameter is required.', example='1024*1024'),
  style?: string(name='Style', description='This parameter is required.', example='<auto>'),
}

model GenerateImageTaskResponseBody = {
  code?: string(name='Code', example='successful'),
  data?: {
    taskList?: [ 
      {
        content?: string(name='Content', example='一直忧伤的猫'),
        id?: long(name='Id', example='1'),
        taskId?: string(name='TaskId', example='e1be065b-adc3-435e-bd01-1c18c5ed75d3'),
        taskStatus?: string(name='TaskStatus', example='SUCCESSED'),
      }
    ](name='TaskList'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='F2F366D6-E9FE-1006-BB70-2C650896AAB5'),
  success?: boolean(name='Success', example='true'),
}

model GenerateImageTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateImageTaskResponseBody(name='body'),
}

/**
 * @summary 智能配图，图片生成任务
 *
 * @param tmpReq GenerateImageTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateImageTaskResponse
 */
async function generateImageTaskWithOptions(tmpReq: GenerateImageTaskRequest, runtime: $RuntimeOptions): GenerateImageTaskResponse {
  tmpReq.validate();
  var request = new GenerateImageTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.paragraphList)) {
    request.paragraphListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.paragraphList, 'ParagraphList', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.articleTaskId)) {
    body['ArticleTaskId'] = request.articleTaskId;
  }
  if (!$isNull(request.paragraphListShrink)) {
    body['ParagraphList'] = request.paragraphListShrink;
  }
  if (!$isNull(request.size)) {
    body['Size'] = request.size;
  }
  if (!$isNull(request.style)) {
    body['Style'] = request.style;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GenerateImageTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 智能配图，图片生成任务
 *
 * @param request GenerateImageTaskRequest
 * @return GenerateImageTaskResponse
 */
async function generateImageTask(request: GenerateImageTaskRequest): GenerateImageTaskResponse {
  var runtime = new $RuntimeOptions{};
  return generateImageTaskWithOptions(request, runtime);
}

model GenerateUploadConfigRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  fileName?: string(name='FileName', example='test.docx'),
  parentDir?: string(name='ParentDir', description='This parameter is required.', example='datasetUpload'),
}

model GenerateUploadConfigResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    fileKey?: string(name='FileKey', example='oss://default/oss-bucket-name/aimiaobi/2021/07/01/1625126400000/1.docx'),
    formDatas?: map[string]any(name='FormDatas'),
    postUrl?: string(name='PostUrl', example='https://bucket-name.oss-cn-hangzhou.aliyuncs.com'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GenerateUploadConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateUploadConfigResponseBody(name='body'),
}

/**
 * @summary 生成上传配置
 *
 * @param request GenerateUploadConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateUploadConfigResponse
 */
async function generateUploadConfigWithOptions(request: GenerateUploadConfigRequest, runtime: $RuntimeOptions): GenerateUploadConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.fileName)) {
    body['FileName'] = request.fileName;
  }
  if (!$isNull(request.parentDir)) {
    body['ParentDir'] = request.parentDir;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GenerateUploadConfig',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 生成上传配置
 *
 * @param request GenerateUploadConfigRequest
 * @return GenerateUploadConfigResponse
 */
async function generateUploadConfig(request: GenerateUploadConfigRequest): GenerateUploadConfigResponse {
  var runtime = new $RuntimeOptions{};
  return generateUploadConfigWithOptions(request, runtime);
}

model GenerateViewPointRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
  referenceData?: {
    miniDoc?: [ string ](name='MiniDoc'),
  }(name='ReferenceData'),
}

model GenerateViewPointShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
  referenceDataShrink?: string(name='ReferenceData'),
}

model GenerateViewPointResponseBody = {
  code?: string(name='Code', example='200'),
  data?: [ 
    {
      point?: string(name='Point'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='94512A33-8EC1-5452-A793-5C91F18ED2F0'),
  success?: boolean(name='Success', example='true'),
}

model GenerateViewPointResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateViewPointResponseBody(name='body'),
}

/**
 * @summary 视角生成
 *
 * @param tmpReq GenerateViewPointRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateViewPointResponse
 */
async function generateViewPointWithOptions(tmpReq: GenerateViewPointRequest, runtime: $RuntimeOptions): GenerateViewPointResponse {
  tmpReq.validate();
  var request = new GenerateViewPointShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.referenceData)) {
    request.referenceDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.referenceData, 'ReferenceData', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.referenceDataShrink)) {
    body['ReferenceData'] = request.referenceDataShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GenerateViewPoint',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 视角生成
 *
 * @param request GenerateViewPointRequest
 * @return GenerateViewPointResponse
 */
async function generateViewPoint(request: GenerateViewPointRequest): GenerateViewPointResponse {
  var runtime = new $RuntimeOptions{};
  return generateViewPointWithOptions(request, runtime);
}

model GetCategoriesByTaskIdRequest {
  taskId?: string(name='TaskId', description='This parameter is required.', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model GetCategoriesByTaskIdResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      category?: string(name='Category'),
      children?: [ 
        {
          category?: string(name='Category'),
        }
      ](name='Children'),
      count?: int32(name='Count', example='2'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetCategoriesByTaskIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCategoriesByTaskIdResponseBody(name='body'),
}

/**
 * @summary 获取某次标签挖掘结果分类
 *
 * @param request GetCategoriesByTaskIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCategoriesByTaskIdResponse
 */
async function getCategoriesByTaskIdWithOptions(request: GetCategoriesByTaskIdRequest, runtime: $RuntimeOptions): GetCategoriesByTaskIdResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetCategoriesByTaskId',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取某次标签挖掘结果分类
 *
 * @param request GetCategoriesByTaskIdRequest
 * @return GetCategoriesByTaskIdResponse
 */
async function getCategoriesByTaskId(request: GetCategoriesByTaskIdRequest): GetCategoriesByTaskIdResponse {
  var runtime = new $RuntimeOptions{};
  return getCategoriesByTaskIdWithOptions(request, runtime);
}

model GetCustomHotTopicBroadcastJobRequest {
  taskId?: string(name='TaskId', description='This parameter is required.', example='2e27abb32cb64f80a0c6e829b6c87a09'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model GetCustomHotTopicBroadcastJobResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    errorMessage?: string(name='ErrorMessage', example='错误信息'),
    hotTopicVersion?: string(name='HotTopicVersion', example='热点话题版本号标识'),
    status?: string(name='Status', example='RUNNING'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetCustomHotTopicBroadcastJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCustomHotTopicBroadcastJobResponseBody(name='body'),
}

/**
 * @summary 获取自定义播报单任务结果
 *
 * @param request GetCustomHotTopicBroadcastJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCustomHotTopicBroadcastJobResponse
 */
async function getCustomHotTopicBroadcastJobWithOptions(request: GetCustomHotTopicBroadcastJobRequest, runtime: $RuntimeOptions): GetCustomHotTopicBroadcastJobResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetCustomHotTopicBroadcastJob',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取自定义播报单任务结果
 *
 * @param request GetCustomHotTopicBroadcastJobRequest
 * @return GetCustomHotTopicBroadcastJobResponse
 */
async function getCustomHotTopicBroadcastJob(request: GetCustomHotTopicBroadcastJobRequest): GetCustomHotTopicBroadcastJobResponse {
  var runtime = new $RuntimeOptions{};
  return getCustomHotTopicBroadcastJobWithOptions(request, runtime);
}

model GetCustomTextRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  commodityCode?: string(name='CommodityCode', example='商品code'),
  id?: long(name='Id', description='This parameter is required.', example='63'),
}

model GetCustomTextResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    content?: string(name='Content', example='内容'),
    createTime?: string(name='CreateTime', example='创建时间'),
    createUser?: string(name='CreateUser', example='创建用户'),
    id?: long(name='Id', example='34'),
    title?: string(name='Title', example='标题'),
    updateTime?: string(name='UpdateTime', example='修改时间'),
    updateUser?: string(name='UpdateUser', example='修改用户'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetCustomTextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCustomTextResponseBody(name='body'),
}

/**
 * @summary 获取自定义文本
 *
 * @param request GetCustomTextRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCustomTextResponse
 */
async function getCustomTextWithOptions(request: GetCustomTextRequest, runtime: $RuntimeOptions): GetCustomTextResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.commodityCode)) {
    body['CommodityCode'] = request.commodityCode;
  }
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetCustomText',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取自定义文本
 *
 * @param request GetCustomTextRequest
 * @return GetCustomTextResponse
 */
async function getCustomText(request: GetCustomTextRequest): GetCustomTextResponse {
  var runtime = new $RuntimeOptions{};
  return getCustomTextWithOptions(request, runtime);
}

model GetCustomTopicSelectionPerspectiveAnalysisTaskRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  taskId?: string(name='TaskId', description='This parameter is required.', example='0dbf1055f8a2475d99904c3b76a0ffba'),
}

model GetCustomTopicSelectionPerspectiveAnalysisTaskResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    customViewPointsResult?: {
      attitudes?: [ 
        {
          attitude?: string(name='Attitude', example='当前观点'),
          attitudeType?: string(name='AttitudeType', example='观点类型'),
          ratio?: string(name='Ratio', example='当前观点占比'),
          viewPoints?: [ 
            {
              outlines?: [ 
                {
                  outline?: string(name='Outline', example='大纲'),
                  summary?: string(name='Summary', example='大纲摘要'),
                }
              ](name='Outlines'),
              point?: string(name='Point', example='视角'),
              summary?: string(name='Summary', example='摘要'),
            }
          ](name='ViewPoints'),
        }
      ](name='Attitudes'),
      topic?: string(name='Topic', example='热点主题事件'),
    }(name='CustomViewPointsResult'),
    errorMessage?: string(name='ErrorMessage', example='错误信息'),
    status?: string(name='Status', example='FAILED'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetCustomTopicSelectionPerspectiveAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCustomTopicSelectionPerspectiveAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 获取自定义选题视角分析任务结果
 *
 * @param request GetCustomTopicSelectionPerspectiveAnalysisTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCustomTopicSelectionPerspectiveAnalysisTaskResponse
 */
async function getCustomTopicSelectionPerspectiveAnalysisTaskWithOptions(request: GetCustomTopicSelectionPerspectiveAnalysisTaskRequest, runtime: $RuntimeOptions): GetCustomTopicSelectionPerspectiveAnalysisTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetCustomTopicSelectionPerspectiveAnalysisTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取自定义选题视角分析任务结果
 *
 * @param request GetCustomTopicSelectionPerspectiveAnalysisTaskRequest
 * @return GetCustomTopicSelectionPerspectiveAnalysisTaskResponse
 */
async function getCustomTopicSelectionPerspectiveAnalysisTask(request: GetCustomTopicSelectionPerspectiveAnalysisTaskRequest): GetCustomTopicSelectionPerspectiveAnalysisTaskResponse {
  var runtime = new $RuntimeOptions{};
  return getCustomTopicSelectionPerspectiveAnalysisTaskWithOptions(request, runtime);
}

model GetDataSourceOrderConfigRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='d9a1f6146a37446495d9985c2e7b267e_p_outbound_public'),
  productCode?: string(name='ProductCode', description='This parameter is required.', example='miaobi'),
}

model GetDataSourceOrderConfigResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    totalDocSize?: int32(name='TotalDocSize', example='1'),
    userConfigDataSourceList?: [ 
      {
        code?: string(name='Code', example='QuarkCommonNews'),
        enable?: boolean(name='Enable'),
        name?: string(name='Name'),
        number?: int32(name='Number', example='20'),
        type?: string(name='Type', example='SystemSearch'),
      }
    ](name='UserConfigDataSourceList'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='428DCC0D-3C63-5306-BD1B-124396AB97BE'),
  success?: boolean(name='Success', example='true'),
}

model GetDataSourceOrderConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDataSourceOrderConfigResponseBody(name='body'),
}

/**
 * @summary 获取系统数据源配置和个人配置
 *
 * @param request GetDataSourceOrderConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDataSourceOrderConfigResponse
 */
async function getDataSourceOrderConfigWithOptions(request: GetDataSourceOrderConfigRequest, runtime: $RuntimeOptions): GetDataSourceOrderConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.productCode)) {
    body['ProductCode'] = request.productCode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDataSourceOrderConfig',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取系统数据源配置和个人配置
 *
 * @param request GetDataSourceOrderConfigRequest
 * @return GetDataSourceOrderConfigResponse
 */
async function getDataSourceOrderConfig(request: GetDataSourceOrderConfigRequest): GetDataSourceOrderConfigResponse {
  var runtime = new $RuntimeOptions{};
  return getDataSourceOrderConfigWithOptions(request, runtime);
}

model GetDatasetRequest {
  datasetId?: long(name='DatasetId', example='1'),
  datasetName?: string(name='DatasetName', example='businessDataset'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model GetDatasetResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    createTime?: string(name='CreateTime', example='2024-11-12 21:46:24'),
    createUser?: string(name='CreateUser', example='xxx'),
    datasetConfig?: {
      searchSourceConfigs?: [ 
        {
          demoQuery?: string(name='DemoQuery', example='可以搜索到的关键词，用来验证是否可用'),
          searchSourceRequestConfig?: {
            body?: string(name='Body', example='{}'),
            connectTimeout?: int32(name='ConnectTimeout', example='30'),
            headers?: [ 
              {
                name?: string(name='Name', example='参数名称'),
                value?: string(name='Value', example='参数值'),
                valueFormat?: string(name='ValueFormat', example='valueType = time 时有效'),
                valueType?: string(name='ValueType', example='参数值数据类型: 默认string'),
              }
            ](name='Headers'),
            method?: string(name='Method', example='请求方式'),
            params?: [ 
              {
                name?: string(name='Name', example='参数名称'),
                value?: string(name='Value', example='参数值'),
                valueFormat?: string(name='ValueFormat', example='valueType = time 时有效'),
                valueType?: string(name='ValueType', example='参数值数据类型: 默认string'),
              }
            ](name='Params'),
            pathParamsEnable?: boolean(name='PathParamsEnable', example='true'),
            socketTimeout?: int32(name='SocketTimeout', example='78'),
            url?: string(name='Url', example='api地址'),
          }(name='SearchSourceRequestConfig'),
          searchSourceResponseConfig?: {
            jqNodes?: [ 
              {
                jqNodes?: [ 
                  {
                    jqNodes?: [ 
                      {
                        key?: string(name='Key', example='title'),
                        path?: string(name='Path', example='.title'),
                        type?: string(name='Type', example='string'),
                      }
                    ](name='JqNodes'),
                    key?: string(name='Key', example='title'),
                    path?: string(name='Path', example='.title'),
                    type?: string(name='Type', example='string'),
                  }
                ](name='JqNodes'),
                key?: string(name='Key', example='节点key'),
                path?: string(name='Path', example='节点路径'),
                type?: string(name='Type', example='节点数据类型：string number list object base'),
              }
            ](name='JqNodes'),
          }(name='SearchSourceResponseConfig'),
          size?: int32(name='Size', example='10'),
        }
      ](name='SearchSourceConfigs'),
    }(name='DatasetConfig'),
    datasetDescription?: string(name='DatasetDescription', example='xxx'),
    datasetId?: long(name='DatasetId', example='1'),
    datasetName?: string(name='DatasetName', example='xxx'),
    datasetType?: string(name='DatasetType', example='CustomSemanticSearch'),
    documentHandleConfig?: {
      disableHandleMultimodalMedia?: boolean(name='DisableHandleMultimodalMedia', example='true'),
    }(name='DocumentHandleConfig'),
    searchDatasetEnable?: int32(name='SearchDatasetEnable', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetDatasetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDatasetResponseBody(name='body'),
}

/**
 * @summary 数据集管理-详情
 *
 * @param request GetDatasetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDatasetResponse
 */
async function getDatasetWithOptions(request: GetDatasetRequest, runtime: $RuntimeOptions): GetDatasetResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!$isNull(request.datasetName)) {
    body['DatasetName'] = request.datasetName;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDataset',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 数据集管理-详情
 *
 * @param request GetDatasetRequest
 * @return GetDatasetResponse
 */
async function getDataset(request: GetDatasetRequest): GetDatasetResponse {
  var runtime = new $RuntimeOptions{};
  return getDatasetWithOptions(request, runtime);
}

model GetDatasetDocumentRequest {
  datasetId?: long(name='DatasetId', example='1'),
  datasetName?: string(name='DatasetName', example='数据集名称'),
  docId?: string(name='DocId', example='xxx'),
  docUuid?: string(name='DocUuid', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model GetDatasetDocumentResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    content?: string(name='Content'),
    disableHandleMultimodalMedia?: boolean(name='DisableHandleMultimodalMedia', example='true'),
    docId?: string(name='DocId', example='用户指定的文档唯一ID'),
    docUuid?: string(name='DocUuid', example='内部文档唯一ID'),
    pubTime?: string(name='PubTime', example='2024-05-14 08:54:33'),
    sourceFrom?: string(name='SourceFrom', example='来源'),
    summary?: string(name='Summary', example='文章摘要'),
    title?: string(name='Title'),
    url?: string(name='Url', example='https://www.aliyun.com'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetDatasetDocumentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDatasetDocumentResponseBody(name='body'),
}

/**
 * @summary 获取数据集文档
 *
 * @param request GetDatasetDocumentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDatasetDocumentResponse
 */
async function getDatasetDocumentWithOptions(request: GetDatasetDocumentRequest, runtime: $RuntimeOptions): GetDatasetDocumentResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!$isNull(request.datasetName)) {
    body['DatasetName'] = request.datasetName;
  }
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.docUuid)) {
    body['DocUuid'] = request.docUuid;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDatasetDocument',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取数据集文档
 *
 * @param request GetDatasetDocumentRequest
 * @return GetDatasetDocumentResponse
 */
async function getDatasetDocument(request: GetDatasetDocumentRequest): GetDatasetDocumentResponse {
  var runtime = new $RuntimeOptions{};
  return getDatasetDocumentWithOptions(request, runtime);
}

model GetDocClusterTaskRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  taskId?: string(name='TaskId', description='This parameter is required.', example='93771c8e1142467fb1aedf1763feba1e'),
}

model GetDocClusterTaskResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    errorMessage?: string(name='ErrorMessage', example='错误信息'),
    status?: string(name='Status', example='PENDING'),
    topics?: [ 
      {
        docIds?: [ string ](name='DocIds'),
        summary?: string(name='Summary', example='聚类主题摘要'),
        title?: string(name='Title', example='聚类主题名'),
      }
    ](name='Topics'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetDocClusterTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDocClusterTaskResponseBody(name='body'),
}

/**
 * @summary 获取文档聚合任务结果
 *
 * @param request GetDocClusterTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDocClusterTaskResponse
 */
async function getDocClusterTaskWithOptions(request: GetDocClusterTaskRequest, runtime: $RuntimeOptions): GetDocClusterTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDocClusterTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取文档聚合任务结果
 *
 * @param request GetDocClusterTaskRequest
 * @return GetDocClusterTaskResponse
 */
async function getDocClusterTask(request: GetDocClusterTaskRequest): GetDocClusterTaskResponse {
  var runtime = new $RuntimeOptions{};
  return getDocClusterTaskWithOptions(request, runtime);
}

model GetDocInfoRequest {
  categoryId?: string(name='CategoryId', example='default'),
  docId?: string(name='DocId', description='This parameter is required.', example='12345'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model GetDocInfoResponseBody = {
  code?: string(name='Code', example='successful'),
  data?: {
    categoryId?: string(name='CategoryId', example='default'),
    docName?: string(name='DocName'),
    docType?: string(name='DocType', example='pdf'),
    fileUrl?: string(name='FileUrl', example='http://xxx/xxx.pdf'),
    status?: int32(name='Status', example='0'),
    statusMessage?: string(name='StatusMessage'),
    videoContents?: [ string ](name='VideoContents'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetDocInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDocInfoResponseBody(name='body'),
}

/**
 * @summary 妙读获取文档信息
 *
 * @param request GetDocInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDocInfoResponse
 */
async function getDocInfoWithOptions(request: GetDocInfoRequest, runtime: $RuntimeOptions): GetDocInfoResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.categoryId)) {
    body['CategoryId'] = request.categoryId;
  }
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDocInfo',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读获取文档信息
 *
 * @param request GetDocInfoRequest
 * @return GetDocInfoResponse
 */
async function getDocInfo(request: GetDocInfoRequest): GetDocInfoResponse {
  var runtime = new $RuntimeOptions{};
  return getDocInfoWithOptions(request, runtime);
}

model GetEnterpriseVocAnalysisTaskRequest {
  taskId?: string(name='TaskId', description='This parameter is required.', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model GetEnterpriseVocAnalysisTaskResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    errorMessage?: string(name='ErrorMessage', example='error'),
    statisticsOverview?: {
      count?: int32(name='Count', example='100'),
      filterDimensionStatistics?: {
        tagValueCountStatistic?: [ 
          {
            tagName?: string(name='TagName', example='xxx'),
            tagTaskType?: string(name='TagTaskType', example='multiTagValues'),
            valueCount?: int32(name='ValueCount', example='100'),
          }
        ](name='TagValueCountStatistic'),
      }(name='FilterDimensionStatistics'),
      tagDimensionStatistics?: {
        tagValueCountStatistic?: [ 
          {
            tagName?: string(name='TagName', example='xxx'),
            tagTaskType?: string(name='TagTaskType', example='multiTagValues'),
            valueCount?: int32(name='ValueCount', example='100'),
          }
        ](name='TagValueCountStatistic'),
      }(name='TagDimensionStatistics'),
    }(name='StatisticsOverview'),
    status?: string(name='Status', example='SUCCESSED'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='200'),
      outputTokens?: long(name='OutputTokens', example='100'),
    }(name='Usage'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetEnterpriseVocAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEnterpriseVocAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 获取企业VOC分析任务结果
 *
 * @param request GetEnterpriseVocAnalysisTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetEnterpriseVocAnalysisTaskResponse
 */
async function getEnterpriseVocAnalysisTaskWithOptions(request: GetEnterpriseVocAnalysisTaskRequest, runtime: $RuntimeOptions): GetEnterpriseVocAnalysisTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetEnterpriseVocAnalysisTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取企业VOC分析任务结果
 *
 * @param request GetEnterpriseVocAnalysisTaskRequest
 * @return GetEnterpriseVocAnalysisTaskResponse
 */
async function getEnterpriseVocAnalysisTask(request: GetEnterpriseVocAnalysisTaskRequest): GetEnterpriseVocAnalysisTaskResponse {
  var runtime = new $RuntimeOptions{};
  return getEnterpriseVocAnalysisTaskWithOptions(request, runtime);
}

model GetGeneratedContentRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  id?: long(name='Id', description='This parameter is required.', example='1'),
}

model GetGeneratedContentResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    content?: string(name='Content'),
    contentDomain?: string(name='ContentDomain', example='media'),
    contentText?: string(name='ContentText'),
    createTime?: string(name='CreateTime', example='2024-01-04 11:46:07'),
    createUser?: string(name='CreateUser', example='1'),
    deviceId?: string(name='DeviceId', example='xxx'),
    id?: long(name='Id', example='86'),
    keywordList?: [ string ](name='KeywordList'),
    keywords?: string(name='Keywords'),
    prompt?: string(name='Prompt'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    title?: string(name='Title'),
    updateTime?: string(name='UpdateTime', example='2024-01-04 11:46:07'),
    updateUser?: string(name='UpdateUser', example='1'),
    uuid?: string(name='Uuid', example='0961a514-2e26-4aa6-b22b-f592d145fe47'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetGeneratedContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetGeneratedContentResponseBody(name='body'),
}

/**
 * @summary 文档管理-查询详情。
 *
 * @param request GetGeneratedContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetGeneratedContentResponse
 */
async function getGeneratedContentWithOptions(request: GetGeneratedContentRequest, runtime: $RuntimeOptions): GetGeneratedContentResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetGeneratedContent',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档管理-查询详情。
 *
 * @param request GetGeneratedContentRequest
 * @return GetGeneratedContentResponse
 */
async function getGeneratedContent(request: GetGeneratedContentRequest): GetGeneratedContentResponse {
  var runtime = new $RuntimeOptions{};
  return getGeneratedContentWithOptions(request, runtime);
}

model GetHotTopicBroadcastRequest {
  calcTotalToken?: boolean(name='CalcTotalToken', example='false'),
  category?: string(name='Category', example='分类筛选'),
  current?: int32(name='Current', example='1'),
  hotTopicVersion?: string(name='HotTopicVersion', example='2024-10-11_13'),
  locationQuery?: string(name='LocationQuery'),
  locations?: [ string ](name='Locations'),
  query?: string(name='Query'),
  size?: int32(name='Size', example='5'),
  stepForCustomSummaryStyleConfig?: {
    summaryImageCount?: int32(name='SummaryImageCount', example='90'),
    summaryModel?: string(name='SummaryModel', example='摘要模型'),
    summaryPrompt?: string(name='SummaryPrompt', example='摘要-自定义Prompt'),
  }(name='StepForCustomSummaryStyleConfig'),
  stepForNewsBroadcastContentConfig?: {
    categories?: [ string ](name='Categories', example='["科技","经济","时政","娱乐"]'),
    customHotValueWeights?: [ 
      {
        dimension?: string(name='Dimension', example='views'),
        weight?: int32(name='Weight', example='1'),
      }
    ](name='CustomHotValueWeights', deprecated=true),
    topicCount?: int32(name='TopicCount', example='10'),
  }(name='StepForNewsBroadcastContentConfig'),
  topics?: [ string ](name='Topics', example='["主题1","主题2"]'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model GetHotTopicBroadcastShrinkRequest {
  calcTotalToken?: boolean(name='CalcTotalToken', example='false'),
  category?: string(name='Category', example='分类筛选'),
  current?: int32(name='Current', example='1'),
  hotTopicVersion?: string(name='HotTopicVersion', example='2024-10-11_13'),
  locationQuery?: string(name='LocationQuery'),
  locationsShrink?: string(name='Locations'),
  query?: string(name='Query'),
  size?: int32(name='Size', example='5'),
  stepForCustomSummaryStyleConfigShrink?: string(name='StepForCustomSummaryStyleConfig'),
  stepForNewsBroadcastContentConfigShrink?: string(name='StepForNewsBroadcastContentConfig'),
  topicsShrink?: string(name='Topics', example='["主题1","主题2"]'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model GetHotTopicBroadcastResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    data?: [ 
      {
        category?: string(name='Category', example='热点话题分类'),
        createTime?: string(name='CreateTime', example='创建时间'),
        customHotValue?: double(name='CustomHotValue', example='34.7905341705522'),
        customTextSummary?: string(name='CustomTextSummary', example='自定义热点话题文本摘要'),
        hotTopic?: string(name='HotTopic', example='热点话题名称'),
        hotTopicVersion?: string(name='HotTopicVersion', example='热点话题摘要版本'),
        hotValue?: double(name='HotValue', example='1.4120480606282884'),
        id?: string(name='Id', example='热点话题ID'),
        images?: [ 
          {
            url?: string(name='Url', example='http://www.example.com/a.png'),
          }
        ](name='Images'),
        inputToken?: int32(name='InputToken', example='29'),
        locations?: [ string ](name='Locations'),
        news?: [ 
          {
            analysisCategory?: string(name='AnalysisCategory'),
            analysisTopic?: string(name='AnalysisTopic', example='聚合后热点名称'),
            author?: string(name='Author'),
            category?: [ string ](name='Category'),
            comments?: [ 
              {
                text?: string(name='Text', example='评论内容'),
                username?: string(name='Username', example='评论用户名'),
              }
            ](name='Comments'),
            content?: string(name='Content'),
            createTime?: string(name='CreateTime', example='2024-06-13 08:45:05'),
            domain?: string(name='Domain'),
            dt?: string(name='Dt', example='2024111110'),
            hotTopic?: string(name='HotTopic', example='原始热点名称'),
            imgList?: [ string ](name='ImgList'),
            logo?: string(name='Logo', description='logo', example='https://www.example.com/a.png'),
            pubTime?: string(name='PubTime', example='2024-10-10 12:12:00'),
            summary?: string(name='Summary', example='摘要'),
            title?: string(name='Title'),
            url?: string(name='Url', example='http://www.example.com/a.png'),
            uuid?: string(name='Uuid', example='主键ID'),
            website?: string(name='Website', example='网站'),
          }
        ](name='News'),
        outputToken?: int32(name='OutputToken', example='22'),
        summary?: {
          inputToken?: int32(name='InputToken', example='17'),
          outputToken?: int32(name='OutputToken', example='41'),
          summaries?: [ 
            {
              summary?: string(name='Summary', example='摘要'),
              title?: string(name='Title', example='标题'),
            }
          ](name='Summaries'),
        }(name='Summary'),
        textSummary?: string(name='TextSummary', example='热点话题文本摘要'),
      }
    ](name='Data'),
    totalCount?: int32(name='TotalCount', example='100'),
    totalTokenInfo?: {
      hotTopicCount?: int32(name='HotTopicCount', example='100'),
      inputTokens?: int32(name='InputTokens', example='100'),
      outputTokens?: int32(name='OutputTokens', example='100'),
      wordCount?: int32(name='WordCount', example='100'),
    }(name='TotalTokenInfo'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetHotTopicBroadcastResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHotTopicBroadcastResponseBody(name='body'),
}

/**
 * @summary 查询新闻播报单
 *
 * @param tmpReq GetHotTopicBroadcastRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHotTopicBroadcastResponse
 */
async function getHotTopicBroadcastWithOptions(tmpReq: GetHotTopicBroadcastRequest, runtime: $RuntimeOptions): GetHotTopicBroadcastResponse {
  tmpReq.validate();
  var request = new GetHotTopicBroadcastShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.locations)) {
    request.locationsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.locations, 'Locations', 'json');
  }
  if (!$isNull(tmpReq.stepForCustomSummaryStyleConfig)) {
    request.stepForCustomSummaryStyleConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.stepForCustomSummaryStyleConfig, 'StepForCustomSummaryStyleConfig', 'json');
  }
  if (!$isNull(tmpReq.stepForNewsBroadcastContentConfig)) {
    request.stepForNewsBroadcastContentConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.stepForNewsBroadcastContentConfig, 'StepForNewsBroadcastContentConfig', 'json');
  }
  if (!$isNull(tmpReq.topics)) {
    request.topicsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.topics, 'Topics', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.calcTotalToken)) {
    body['CalcTotalToken'] = request.calcTotalToken;
  }
  if (!$isNull(request.category)) {
    body['Category'] = request.category;
  }
  if (!$isNull(request.current)) {
    body['Current'] = request.current;
  }
  if (!$isNull(request.hotTopicVersion)) {
    body['HotTopicVersion'] = request.hotTopicVersion;
  }
  if (!$isNull(request.locationQuery)) {
    body['LocationQuery'] = request.locationQuery;
  }
  if (!$isNull(request.locationsShrink)) {
    body['Locations'] = request.locationsShrink;
  }
  if (!$isNull(request.query)) {
    body['Query'] = request.query;
  }
  if (!$isNull(request.size)) {
    body['Size'] = request.size;
  }
  if (!$isNull(request.stepForCustomSummaryStyleConfigShrink)) {
    body['StepForCustomSummaryStyleConfig'] = request.stepForCustomSummaryStyleConfigShrink;
  }
  if (!$isNull(request.stepForNewsBroadcastContentConfigShrink)) {
    body['StepForNewsBroadcastContentConfig'] = request.stepForNewsBroadcastContentConfigShrink;
  }
  if (!$isNull(request.topicsShrink)) {
    body['Topics'] = request.topicsShrink;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetHotTopicBroadcast',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询新闻播报单
 *
 * @param request GetHotTopicBroadcastRequest
 * @return GetHotTopicBroadcastResponse
 */
async function getHotTopicBroadcast(request: GetHotTopicBroadcastRequest): GetHotTopicBroadcastResponse {
  var runtime = new $RuntimeOptions{};
  return getHotTopicBroadcastWithOptions(request, runtime);
}

model GetInterveneGlobalReplyRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='fcb14f25c9ee41ccad33a049de8f941b_p_outbound_public'),
}

model GetInterveneGlobalReplyResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    replyMessagList?: [ 
      {
        message?: string(name='Message', example='success'),
        replyType?: string(name='ReplyType', example='namespace_qa_query'),
      }
    ](name='ReplyMessagList'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='true'),
}

model GetInterveneGlobalReplyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInterveneGlobalReplyResponseBody(name='body'),
}

/**
 * @summary 获得干预全局回复
 *
 * @param request GetInterveneGlobalReplyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInterveneGlobalReplyResponse
 */
async function getInterveneGlobalReplyWithOptions(request: GetInterveneGlobalReplyRequest, runtime: $RuntimeOptions): GetInterveneGlobalReplyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetInterveneGlobalReply',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获得干预全局回复
 *
 * @param request GetInterveneGlobalReplyRequest
 * @return GetInterveneGlobalReplyResponse
 */
async function getInterveneGlobalReply(request: GetInterveneGlobalReplyRequest): GetInterveneGlobalReplyResponse {
  var runtime = new $RuntimeOptions{};
  return getInterveneGlobalReplyWithOptions(request, runtime);
}

model GetInterveneImportTaskInfoRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='67c520d1fa43455ea44fb69fa402d54d_p_beebot_public'),
  taskId?: string(name='TaskId', example='19162157'),
}

model GetInterveneImportTaskInfoResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    status?: {
      msg?: string(name='Msg', example='success'),
      percentage?: int32(name='Percentage', example='80'),
      status?: int32(name='Status', example='0'),
      taskId?: string(name='TaskId', example='41405255'),
      taskName?: string(name='TaskName', example='ft-task-20190101m8rnK'),
    }(name='Status'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetInterveneImportTaskInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInterveneImportTaskInfoResponseBody(name='body'),
}

/**
 * @summary 获得导入任务信息
 *
 * @param request GetInterveneImportTaskInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInterveneImportTaskInfoResponse
 */
async function getInterveneImportTaskInfoWithOptions(request: GetInterveneImportTaskInfoRequest, runtime: $RuntimeOptions): GetInterveneImportTaskInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetInterveneImportTaskInfo',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获得导入任务信息
 *
 * @param request GetInterveneImportTaskInfoRequest
 * @return GetInterveneImportTaskInfoResponse
 */
async function getInterveneImportTaskInfo(request: GetInterveneImportTaskInfoRequest): GetInterveneImportTaskInfoResponse {
  var runtime = new $RuntimeOptions{};
  return getInterveneImportTaskInfoWithOptions(request, runtime);
}

model GetInterveneRuleDetailRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='2daaa2e0c209xb26acb97009ea77bd4b_p_efm'),
  ruleId?: long(name='RuleId', example='12345'),
}

model GetInterveneRuleDetailResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    interveneRuleDetail?: {
      answerConfig?: [ 
        {
          answerType?: int32(name='AnswerType', example='0'),
          message?: string(name='Message'),
          namespace?: string(name='Namespace', example='namespace_qa_query'),
        }
      ](name='AnswerConfig'),
      effectConfig?: {
        effectType?: int32(name='EffectType', example='0'),
        endTime?: string(name='EndTime', example='2023-11-25 14:21:15'),
        startTime?: string(name='StartTime', example='2023-11-25 14:21:15'),
      }(name='EffectConfig'),
      interveneType?: int32(name='InterveneType', example='0'),
      namespaceList?: [ string ](name='NamespaceList'),
      ruleId?: long(name='RuleId', example='100418'),
      ruleName?: string(name='RuleName'),
    }(name='InterveneRuleDetail'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='428DCC0D-3C63-5306-BD1B-124396AB97BE'),
  success?: boolean(name='Success', example='true'),
}

model GetInterveneRuleDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInterveneRuleDetailResponseBody(name='body'),
}

/**
 * @summary 获得干预项规则详情
 *
 * @param request GetInterveneRuleDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInterveneRuleDetailResponse
 */
async function getInterveneRuleDetailWithOptions(request: GetInterveneRuleDetailRequest, runtime: $RuntimeOptions): GetInterveneRuleDetailResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.ruleId)) {
    body['RuleId'] = request.ruleId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetInterveneRuleDetail',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获得干预项规则详情
 *
 * @param request GetInterveneRuleDetailRequest
 * @return GetInterveneRuleDetailResponse
 */
async function getInterveneRuleDetail(request: GetInterveneRuleDetailRequest): GetInterveneRuleDetailResponse {
  var runtime = new $RuntimeOptions{};
  return getInterveneRuleDetailWithOptions(request, runtime);
}

model GetInterveneTemplateFileUrlRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
}

model GetInterveneTemplateFileUrlResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    fileUrl?: string(name='FileUrl', example='http://xxx/xxx.xls'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='DA021073-17CE-5CCF-9FEB-93226C766887'),
  success?: boolean(name='Success', example='true'),
}

model GetInterveneTemplateFileUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInterveneTemplateFileUrlResponseBody(name='body'),
}

/**
 * @summary 获得干预导入模版文件下载地址
 *
 * @param request GetInterveneTemplateFileUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInterveneTemplateFileUrlResponse
 */
async function getInterveneTemplateFileUrlWithOptions(request: GetInterveneTemplateFileUrlRequest, runtime: $RuntimeOptions): GetInterveneTemplateFileUrlResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetInterveneTemplateFileUrl',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获得干预导入模版文件下载地址
 *
 * @param request GetInterveneTemplateFileUrlRequest
 * @return GetInterveneTemplateFileUrlResponse
 */
async function getInterveneTemplateFileUrl(request: GetInterveneTemplateFileUrlRequest): GetInterveneTemplateFileUrlResponse {
  var runtime = new $RuntimeOptions{};
  return getInterveneTemplateFileUrlWithOptions(request, runtime);
}

model GetMaterialByIdRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='67c520d1fa43455ea44fb69fa402d54d_p_beebot_public'),
  id?: long(name='Id', description='This parameter is required.', example='60'),
}

model GetMaterialByIdResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  data?: {
    author?: string(name='Author'),
    createTime?: string(name='CreateTime', example='2023-03-21 11:34:19'),
    createUser?: string(name='CreateUser', example='1'),
    docKeywords?: [ string ](name='DocKeywords'),
    docType?: string(name='DocType', example='pdf'),
    externalUrl?: string(name='ExternalUrl', example='https://www.example.com'),
    htmlContent?: string(name='HtmlContent'),
    id?: long(name='Id', example='32'),
    pubTime?: string(name='PubTime', example='2023-04-11 06:14:07'),
    publicUrl?: string(name='PublicUrl', example='https://www.example.com'),
    shareAttr?: int32(name='ShareAttr', example='1'),
    srcFrom?: string(name='SrcFrom', example='user_upload'),
    summary?: string(name='Summary'),
    textContent?: string(name='TextContent'),
    thumbnailInBase64?: string(name='ThumbnailInBase64'),
    title?: string(name='Title'),
    updateTime?: string(name='UpdateTime', example='2022-04-08 19:33:01'),
    updateUser?: string(name='UpdateUser', example='1'),
    url?: string(name='Url', example='https://www.example.com'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='数据不存在'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='false'),
}

model GetMaterialByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMaterialByIdResponseBody(name='body'),
}

/**
 * @summary 根据ID获取素材内容
 *
 * @param request GetMaterialByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMaterialByIdResponse
 */
async function getMaterialByIdWithOptions(request: GetMaterialByIdRequest, runtime: $RuntimeOptions): GetMaterialByIdResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMaterialById',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据ID获取素材内容
 *
 * @param request GetMaterialByIdRequest
 * @return GetMaterialByIdResponse
 */
async function getMaterialById(request: GetMaterialByIdRequest): GetMaterialByIdResponse {
  var runtime = new $RuntimeOptions{};
  return getMaterialByIdWithOptions(request, runtime);
}

model GetPropertiesRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxx_efm'),
}

model GetPropertiesResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  data?: {
    chatConfig?: map[string]any(name='ChatConfig'),
    consoleConfig?: {
      tipContent?: string(name='TipContent', example='xx'),
      title?: string(name='Title'),
    }(name='ConsoleConfig'),
    generalConfigMap?: map[string]any(name='GeneralConfigMap'),
    intelligentSearchConfig?: {
      copilotPreciseSearchSources?: [ 
        {
          code?: string(name='Code', example='x'),
          datasetName?: string(name='DatasetName', example='x'),
          name?: string(name='Name', example='x'),
        }
      ](name='CopilotPreciseSearchSources'),
      productDescription?: string(name='ProductDescription', example='xxx'),
      searchSamples?: [ 
        {
          articles?: [ 
            {
              select?: boolean(name='Select', example='true'),
              stared?: boolean(name='Stared', example='false'),
              title?: string(name='Title', example='xx'),
              url?: string(name='Url', example='http://xxx.com'),
            }
          ](name='Articles'),
          prompt?: string(name='Prompt', example='xx'),
          text?: string(name='Text', example='xxx'),
        }
      ](name='SearchSamples'),
      searchSources?: [ 
        {
          code?: string(name='Code', example='xx'),
          datasetName?: string(name='DatasetName', example='xx'),
          name?: string(name='Name', example='xx'),
        }
      ](name='SearchSources'),
    }(name='IntelligentSearchConfig'),
    searchSources?: [ 
      {
        label?: string(name='Label'),
        value?: string(name='Value', example='SystemSearch'),
      }
    ](name='SearchSources'),
    slrAuthorized?: boolean(name='SlrAuthorized', example='true'),
    userInfo?: {
      agentId?: string(name='AgentId', example='1'),
      tenantId?: string(name='TenantId', example='1'),
      userId?: string(name='UserId', example='1'),
      username?: string(name='Username', example='admin'),
    }(name='UserInfo'),
    wanxiangImageSizeConfig?: [ 
      {
        name?: string(name='Name', example='1:1'),
        value?: string(name='Value', example='1024*1024'),
      }
    ](name='WanxiangImageSizeConfig'),
    wanxiangImageStyleConfig?: [ 
      {
        name?: string(name='Name'),
        pic?: string(name='Pic', example='https://img.alicdn.com/imgextra/i4/O1CN01RzKicz1W0YWzYkWcK_!!6000000002726-2-tps-132-104.png'),
        value?: string(name='Value', example='<auto>'),
      }
    ](name='WanxiangImageStyleConfig'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='true'),
}

model GetPropertiesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPropertiesResponseBody(name='body'),
}

/**
 * @summary 获取当前用户的配置
 *
 * @param request GetPropertiesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPropertiesResponse
 */
async function getPropertiesWithOptions(request: GetPropertiesRequest, runtime: $RuntimeOptions): GetPropertiesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetProperties',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取当前用户的配置
 *
 * @param request GetPropertiesRequest
 * @return GetPropertiesResponse
 */
async function getProperties(request: GetPropertiesRequest): GetPropertiesResponse {
  var runtime = new $RuntimeOptions{};
  return getPropertiesWithOptions(request, runtime);
}

model GetSmartClipTaskRequest {
  taskId?: string(name='TaskId', description='This parameter is required.', example='task-03d46184ee7d8749'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model GetSmartClipTaskResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    errorMessage?: string(name='ErrorMessage'),
    status?: string(name='Status', example='RUNNING'),
    subJobs?: [ 
      {
        errorMessage?: string(name='ErrorMessage', example='x\\"x\\"x\\"x'),
        fileAttr?: {
          duration?: double(name='Duration', example='120'),
          fileLength?: string(name='FileLength', example='290804'),
          fileName?: string(name='FileName', example='2024-12-12.mp4'),
          height?: int32(name='Height', example='1080'),
          tmpUrl?: string(name='TmpUrl', example='http://www.example.com/tmp.mp4'),
          width?: int32(name='Width', example='1920'),
        }(name='FileAttr'),
        fileKey?: string(name='FileKey', example='oss://default/bucket-name/path-xxx/xxx-1.mp4'),
        status?: string(name='Status', example='RUNNING'),
        subJobId?: string(name='SubJobId', example='xxxxx'),
      }
    ](name='SubJobs'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetSmartClipTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSmartClipTaskResponseBody(name='body'),
}

/**
 * @summary 查询一键成片剪辑任务
 *
 * @param request GetSmartClipTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSmartClipTaskResponse
 */
async function getSmartClipTaskWithOptions(request: GetSmartClipTaskRequest, runtime: $RuntimeOptions): GetSmartClipTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetSmartClipTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询一键成片剪辑任务
 *
 * @param request GetSmartClipTaskRequest
 * @return GetSmartClipTaskResponse
 */
async function getSmartClipTask(request: GetSmartClipTaskRequest): GetSmartClipTaskResponse {
  var runtime = new $RuntimeOptions{};
  return getSmartClipTaskWithOptions(request, runtime);
}

model GetTopicByIdRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  id?: string(name='Id', description='This parameter is required.', example='数据ID'),
}

model GetTopicByIdResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    asyncTaskId?: string(name='AsyncTaskId', example='异步任务ID（自定义主题场景下使用）'),
    createUser?: string(name='CreateUser', example='创建用户ID（自定义主题场景下使用）'),
    hotValue?: long(name='HotValue', example='43'),
    id?: string(name='Id', example='热榜ID'),
    status?: string(name='Status', example='PENDING'),
    structureSummary?: [ 
      {
        docList?: [ 
          {
            source?: string(name='Source'),
            title?: string(name='Title'),
            url?: string(name='Url', example='http://www.example.com'),
          }
        ](name='DocList'),
        summary?: string(name='Summary', example='摘要'),
        title?: string(name='Title', example='标题'),
      }
    ](name='StructureSummary'),
    summary?: string(name='Summary', example='热榜摘要'),
    taskErrorMessage?: string(name='TaskErrorMessage', example='异步任务失败错误信息'),
    taskStatus?: int32(name='TaskStatus', example='14'),
    topic?: string(name='Topic', example='主题唯一名称'),
    topicSource?: string(name='TopicSource', example='热榜源，目前支持的热榜源: Toutiao：头条、Quark：夸克、Baidu：百度、Sina：新浪。Custom：自定义、Aggregation：热点话题榜'),
    version?: string(name='Version', example='数据版本'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetTopicByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTopicByIdResponseBody(name='body'),
}

/**
 * @summary 根据ID获取热点事件信息
 *
 * @param request GetTopicByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTopicByIdResponse
 */
async function getTopicByIdWithOptions(request: GetTopicByIdRequest, runtime: $RuntimeOptions): GetTopicByIdResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTopicById',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据ID获取热点事件信息
 *
 * @param request GetTopicByIdRequest
 * @return GetTopicByIdResponse
 */
async function getTopicById(request: GetTopicByIdRequest): GetTopicByIdResponse {
  var runtime = new $RuntimeOptions{};
  return getTopicByIdWithOptions(request, runtime);
}

model GetTopicSelectionPerspectiveAnalysisTaskRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  taskId?: string(name='TaskId', example='c9f226b02cca4f42a84c5e955c39dfd2'),
}

model GetTopicSelectionPerspectiveAnalysisTaskResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    errorMessage?: string(name='ErrorMessage', example='错误信息'),
    freshViewPointsResult?: {
      attitudes?: [ 
        {
          attitude?: string(name='Attitude', example='当前观点'),
          attitudeType?: string(name='AttitudeType', example='观点类型'),
          ratio?: string(name='Ratio', example='当前观点占比'),
          viewPoints?: [ 
            {
              outlines?: [ 
                {
                  outline?: string(name='Outline', example='大纲'),
                  summary?: string(name='Summary', example='大纲摘要'),
                }
              ](name='Outlines'),
              point?: string(name='Point', example='视角'),
              summary?: string(name='Summary', example='摘要'),
            }
          ](name='ViewPoints'),
        }
      ](name='Attitudes'),
    }(name='FreshViewPointsResult'),
    hotViewPointsResult?: {
      attitudes?: [ 
        {
          attitude?: string(name='Attitude', example='当前观点'),
          attitudeType?: string(name='AttitudeType', example='观点类型'),
          news?: [ 
            {
              content?: string(name='Content'),
              createTime?: string(name='CreateTime'),
              docId?: string(name='DocId', example='9957175DEDCF49C5ACF7A956B4FD67B2'),
              docUuid?: string(name='DocUuid', example='123456'),
              imageUrls?: [ string ](name='ImageUrls', example='https://www.example.com/aaa.png'),
              pubTime?: string(name='PubTime'),
              source?: string(name='Source'),
              summary?: string(name='Summary'),
              tags?: [ string ](name='Tags', example='["标签1","标签2"]'),
              title?: string(name='Title'),
              topic?: string(name='Topic', example='文章主题'),
              url?: string(name='Url'),
            }
          ](name='News'),
          ratio?: string(name='Ratio', example='当前观点占比'),
          viewPoints?: [ 
            {
              outlines?: [ 
                {
                  outline?: string(name='Outline', example='大纲'),
                  summary?: string(name='Summary', example='大纲摘要'),
                }
              ](name='Outlines'),
              point?: string(name='Point', example='视角'),
              summary?: string(name='Summary', example='摘要'),
            }
          ](name='ViewPoints'),
        }
      ](name='Attitudes'),
    }(name='HotViewPointsResult'),
    status?: string(name='Status', example='SUSPENDED'),
    timedViewPointsResult?: {
      attitudes?: [ 
        {
          attitude?: string(name='Attitude', example='当前观点'),
          attitudeType?: string(name='AttitudeType', example='观点类型'),
          pubTime?: string(name='PubTime', example='2024-01-22 10:29'),
          ratio?: string(name='Ratio', example='当前观点占比'),
          source?: string(name='Source', example='新浪'),
          title?: string(name='Title', example='标题'),
          url?: string(name='Url', example='http://www.example.com/news/1.html'),
          viewPoints?: [ 
            {
              outlines?: [ 
                {
                  outline?: string(name='Outline', example='大纲'),
                  summary?: string(name='Summary', example='大纲摘要'),
                }
              ](name='Outlines'),
              point?: string(name='Point', example='视角'),
              summary?: string(name='Summary', example='摘要'),
            }
          ](name='ViewPoints'),
        }
      ](name='Attitudes'),
    }(name='TimedViewPointsResult'),
    topic?: string(name='Topic', example='热点主题事件'),
    topicSummaryResult?: {
      summaries?: [ 
        {
          docList?: [ 
            {
              source?: string(name='Source'),
              title?: string(name='Title'),
              url?: string(name='Url', example='http://www.example.com'),
            }
          ](name='DocList'),
          summary?: string(name='Summary', example='摘要'),
          title?: string(name='Title', example='标题'),
        }
      ](name='Summaries'),
    }(name='TopicSummaryResult'),
    webReviewPointsResult?: {
      attitudes?: [ 
        {
          attitude?: string(name='Attitude', example='当前观点'),
          attitudeType?: string(name='AttitudeType', example='观点类型'),
          comments?: [ 
            {
              source?: string(name='Source', example='来源'),
              text?: string(name='Text', example='评论内容'),
              title?: string(name='Title', example='标题'),
              url?: string(name='Url', example='当前评论所属的URL'),
              username?: string(name='Username', example='评论用户名'),
            }
          ](name='Comments'),
          ratio?: string(name='Ratio', example='当前观点占比'),
          viewPoints?: [ 
            {
              outlines?: [ 
                {
                  outline?: string(name='Outline', example='大纲'),
                  summary?: string(name='Summary', example='大纲摘要'),
                }
              ](name='Outlines'),
              point?: string(name='Point', example='视角'),
              summary?: string(name='Summary', example='摘要'),
            }
          ](name='ViewPoints'),
        }
      ](name='Attitudes'),
    }(name='WebReviewPointsResult'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model GetTopicSelectionPerspectiveAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTopicSelectionPerspectiveAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 获取选题视角分析任务结果
 *
 * @param request GetTopicSelectionPerspectiveAnalysisTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTopicSelectionPerspectiveAnalysisTaskResponse
 */
async function getTopicSelectionPerspectiveAnalysisTaskWithOptions(request: GetTopicSelectionPerspectiveAnalysisTaskRequest, runtime: $RuntimeOptions): GetTopicSelectionPerspectiveAnalysisTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTopicSelectionPerspectiveAnalysisTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取选题视角分析任务结果
 *
 * @param request GetTopicSelectionPerspectiveAnalysisTaskRequest
 * @return GetTopicSelectionPerspectiveAnalysisTaskResponse
 */
async function getTopicSelectionPerspectiveAnalysisTask(request: GetTopicSelectionPerspectiveAnalysisTaskRequest): GetTopicSelectionPerspectiveAnalysisTaskResponse {
  var runtime = new $RuntimeOptions{};
  return getTopicSelectionPerspectiveAnalysisTaskWithOptions(request, runtime);
}

model ImportInterveneFileRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  docName?: string(name='DocName', example='import.xls'),
  fileKey?: string(name='FileKey', example='import.xsl'),
  fileUrl?: string(name='FileUrl', example='http://xxx/xxx.xls'),
}

model ImportInterveneFileResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    failIdList?: [ string ](name='FailIdList'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='true'),
}

model ImportInterveneFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportInterveneFileResponseBody(name='body'),
}

/**
 * @summary 导入干预文件
 *
 * @param request ImportInterveneFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportInterveneFileResponse
 */
async function importInterveneFileWithOptions(request: ImportInterveneFileRequest, runtime: $RuntimeOptions): ImportInterveneFileResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.docName)) {
    body['DocName'] = request.docName;
  }
  if (!$isNull(request.fileKey)) {
    body['FileKey'] = request.fileKey;
  }
  if (!$isNull(request.fileUrl)) {
    body['FileUrl'] = request.fileUrl;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ImportInterveneFile',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 导入干预文件
 *
 * @param request ImportInterveneFileRequest
 * @return ImportInterveneFileResponse
 */
async function importInterveneFile(request: ImportInterveneFileRequest): ImportInterveneFileResponse {
  var runtime = new $RuntimeOptions{};
  return importInterveneFileWithOptions(request, runtime);
}

model ImportInterveneFileAsyncRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
  docName?: string(name='DocName', example='import.xls'),
  fileKey?: string(name='FileKey', example='import.xls'),
  fileUrl?: string(name='FileUrl', example='https://xxx/import.xls'),
}

model ImportInterveneFileAsyncResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    failIdList?: [ string ](name='FailIdList'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='94512A33-8EC1-5452-A793-5C91F18ED2F0'),
  success?: boolean(name='Success', example='true'),
}

model ImportInterveneFileAsyncResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportInterveneFileAsyncResponseBody(name='body'),
}

/**
 * @summary 异步导入干预文件
 *
 * @param request ImportInterveneFileAsyncRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportInterveneFileAsyncResponse
 */
async function importInterveneFileAsyncWithOptions(request: ImportInterveneFileAsyncRequest, runtime: $RuntimeOptions): ImportInterveneFileAsyncResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.docName)) {
    body['DocName'] = request.docName;
  }
  if (!$isNull(request.fileKey)) {
    body['FileKey'] = request.fileKey;
  }
  if (!$isNull(request.fileUrl)) {
    body['FileUrl'] = request.fileUrl;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ImportInterveneFileAsync',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 异步导入干预文件
 *
 * @param request ImportInterveneFileAsyncRequest
 * @return ImportInterveneFileAsyncResponse
 */
async function importInterveneFileAsync(request: ImportInterveneFileAsyncRequest): ImportInterveneFileAsyncResponse {
  var runtime = new $RuntimeOptions{};
  return importInterveneFileAsyncWithOptions(request, runtime);
}

model InsertInterveneGlobalReplyRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxx_efm'),
  replyMessagList?: [ 
    {
      message?: string(name='Message'),
      replyType?: string(name='ReplyType'),
    }
  ](name='ReplyMessagList'),
}

model InsertInterveneGlobalReplyShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxx_efm'),
  replyMessagListShrink?: string(name='ReplyMessagList'),
}

model InsertInterveneGlobalReplyResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    failIdList?: [ string ](name='FailIdList'),
    taskId?: string(name='TaskId', example='4829'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='true'),
}

model InsertInterveneGlobalReplyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InsertInterveneGlobalReplyResponseBody(name='body'),
}

/**
 * @summary 设置干预全局回复
 *
 * @param tmpReq InsertInterveneGlobalReplyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InsertInterveneGlobalReplyResponse
 */
async function insertInterveneGlobalReplyWithOptions(tmpReq: InsertInterveneGlobalReplyRequest, runtime: $RuntimeOptions): InsertInterveneGlobalReplyResponse {
  tmpReq.validate();
  var request = new InsertInterveneGlobalReplyShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.replyMessagList)) {
    request.replyMessagListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.replyMessagList, 'ReplyMessagList', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.replyMessagListShrink)) {
    body['ReplyMessagList'] = request.replyMessagListShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'InsertInterveneGlobalReply',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 设置干预全局回复
 *
 * @param request InsertInterveneGlobalReplyRequest
 * @return InsertInterveneGlobalReplyResponse
 */
async function insertInterveneGlobalReply(request: InsertInterveneGlobalReplyRequest): InsertInterveneGlobalReplyResponse {
  var runtime = new $RuntimeOptions{};
  return insertInterveneGlobalReplyWithOptions(request, runtime);
}

model InsertInterveneRuleRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  interveneRuleConfig?: {
    answerConfig?: [ 
      {
        answerType?: int32(name='AnswerType', example='0'),
        message?: string(name='Message'),
        namespace?: string(name='Namespace', example='namespace_qa_query'),
      }
    ](name='AnswerConfig'),
    effectConfig?: {
      effectType?: int32(name='EffectType', example='0'),
      endTime?: string(name='EndTime', example='2023-03-28 06:04:29'),
      startTime?: string(name='StartTime', example='2023-03-28 06:04:29'),
    }(name='EffectConfig'),
    interveneConfigList?: [ 
      {
        id?: string(name='Id', description='id', example='37249'),
        operationType?: int32(name='OperationType', example='0'),
        query?: string(name='Query'),
      }
    ](name='InterveneConfigList'),
    interveneType?: int32(name='InterveneType', example='0'),
    namespaceList?: [ string ](name='NamespaceList'),
    ruleId?: long(name='RuleId', example='2'),
    ruleName?: string(name='RuleName', example='tf-test-rule'),
  }(name='InterveneRuleConfig'),
}

model InsertInterveneRuleShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  interveneRuleConfigShrink?: string(name='InterveneRuleConfig'),
}

model InsertInterveneRuleResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    ruleId?: long(name='RuleId', example='12345'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='DD656AF9-0839-521A-A3D2-F320009F9C87'),
  success?: boolean(name='Success', example='true'),
}

model InsertInterveneRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InsertInterveneRuleResponseBody(name='body'),
}

/**
 * @summary 插入干预规则
 *
 * @param tmpReq InsertInterveneRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InsertInterveneRuleResponse
 */
async function insertInterveneRuleWithOptions(tmpReq: InsertInterveneRuleRequest, runtime: $RuntimeOptions): InsertInterveneRuleResponse {
  tmpReq.validate();
  var request = new InsertInterveneRuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.interveneRuleConfig)) {
    request.interveneRuleConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.interveneRuleConfig, 'InterveneRuleConfig', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.interveneRuleConfigShrink)) {
    body['InterveneRuleConfig'] = request.interveneRuleConfigShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'InsertInterveneRule',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 插入干预规则
 *
 * @param request InsertInterveneRuleRequest
 * @return InsertInterveneRuleResponse
 */
async function insertInterveneRule(request: InsertInterveneRuleRequest): InsertInterveneRuleResponse {
  var runtime = new $RuntimeOptions{};
  return insertInterveneRuleWithOptions(request, runtime);
}

model ListAnalysisTagDetailByTaskIdRequest {
  categories?: [ string ](name='Categories'),
  current?: int32(name='Current', example='1'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='token-xxxx'),
  size?: int32(name='Size', example='3'),
  taskId?: string(name='TaskId', description='This parameter is required.', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model ListAnalysisTagDetailByTaskIdShrinkRequest {
  categoriesShrink?: string(name='Categories'),
  current?: int32(name='Current', example='1'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='token-xxxx'),
  size?: int32(name='Size', example='3'),
  taskId?: string(name='TaskId', description='This parameter is required.', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model ListAnalysisTagDetailByTaskIdResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      content?: string(name='Content', example='xxx'),
      contentTags?: [ 
        {
          summaryOverview?: string(name='SummaryOverview', example='xxx'),
          tagName?: string(name='TagName', example='xxx'),
          tags?: [ string ](name='Tags'),
        }
      ](name='ContentTags'),
      id?: long(name='Id', example='112'),
      tagTaskType?: string(name='TagTaskType', example='summaryAndOverview'),
      taskId?: string(name='TaskId', example='xxx'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='10'),
  message?: string(name='Message', example='success'),
  nextToken?: string(name='NextToken', example='token-xxxx'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListAnalysisTagDetailByTaskIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAnalysisTagDetailByTaskIdResponseBody(name='body'),
}

/**
 * @summary 分页获取企业VOC分析任务明细列表
 *
 * @param tmpReq ListAnalysisTagDetailByTaskIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAnalysisTagDetailByTaskIdResponse
 */
async function listAnalysisTagDetailByTaskIdWithOptions(tmpReq: ListAnalysisTagDetailByTaskIdRequest, runtime: $RuntimeOptions): ListAnalysisTagDetailByTaskIdResponse {
  tmpReq.validate();
  var request = new ListAnalysisTagDetailByTaskIdShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.categories)) {
    request.categoriesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.categories, 'Categories', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.categoriesShrink)) {
    body['Categories'] = request.categoriesShrink;
  }
  if (!$isNull(request.current)) {
    body['Current'] = request.current;
  }
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.size)) {
    body['Size'] = request.size;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAnalysisTagDetailByTaskId',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 分页获取企业VOC分析任务明细列表
 *
 * @param request ListAnalysisTagDetailByTaskIdRequest
 * @return ListAnalysisTagDetailByTaskIdResponse
 */
async function listAnalysisTagDetailByTaskId(request: ListAnalysisTagDetailByTaskIdRequest): ListAnalysisTagDetailByTaskIdResponse {
  var runtime = new $RuntimeOptions{};
  return listAnalysisTagDetailByTaskIdWithOptions(request, runtime);
}

model ListAsyncTasksRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='cd327c3d5d5e44159cc716e23bfa530e_p_beebot_public'),
  createTimeEnd?: string(name='CreateTimeEnd', example='2023-03-18 02:00:00'),
  createTimeStart?: string(name='CreateTimeStart', example='2023-02-19 07:28:11'),
  current?: int32(name='Current', example='1'),
  size?: int32(name='Size', example='10'),
  taskCode?: string(name='TaskCode', example='MaterialDocumentUpload'),
  taskName?: string(name='TaskName'),
  taskStatus?: int32(name='TaskStatus', example='1'),
  taskStatusList?: [ int32 ](name='TaskStatusList'),
  taskType?: string(name='TaskType'),
  taskTypeList?: [ string ](name='TaskTypeList'),
}

model ListAsyncTasksShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='cd327c3d5d5e44159cc716e23bfa530e_p_beebot_public'),
  createTimeEnd?: string(name='CreateTimeEnd', example='2023-03-18 02:00:00'),
  createTimeStart?: string(name='CreateTimeStart', example='2023-02-19 07:28:11'),
  current?: int32(name='Current', example='1'),
  size?: int32(name='Size', example='10'),
  taskCode?: string(name='TaskCode', example='MaterialDocumentUpload'),
  taskName?: string(name='TaskName'),
  taskStatus?: int32(name='TaskStatus', example='1'),
  taskStatusListShrink?: string(name='TaskStatusList'),
  taskType?: string(name='TaskType'),
  taskTypeListShrink?: string(name='TaskTypeList'),
}

model ListAsyncTasksResponseBody = {
  code?: string(name='Code', example='200'),
  current?: int32(name='Current', example='1'),
  data?: [ 
    {
      createTime?: string(name='CreateTime', example='2020-12-23 15:41:58'),
      createUser?: string(name='CreateUser', example='1111'),
      id?: long(name='Id', example='1'),
      taskCode?: string(name='TaskCode', example='MaterialDocumentUpload'),
      taskDefinition?: string(name='TaskDefinition', example='{}'),
      taskEndTime?: string(name='TaskEndTime', example='2023-03-09 00:00:00'),
      taskErrorMessage?: string(name='TaskErrorMessage'),
      taskExecuteTime?: string(name='TaskExecuteTime', example='2023-10-14 14:30:00'),
      taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
      taskInnerErrorMessage?: string(name='TaskInnerErrorMessage'),
      taskIntermediateResult?: string(name='TaskIntermediateResult', example='{}'),
      taskName?: string(name='TaskName'),
      taskParam?: string(name='TaskParam', example='{}'),
      taskProgressMessage?: string(name='TaskProgressMessage', example='{}'),
      taskResult?: string(name='TaskResult', example='{}'),
      taskRetryCount?: string(name='TaskRetryCount', example='1'),
      taskStartTime?: string(name='TaskStartTime', example='2023-03-20 10:53:00'),
      taskStatus?: int32(name='TaskStatus', example='1'),
      taskType?: string(name='TaskType', example='test'),
      updateTime?: string(name='UpdateTime', example='2023-02-16 10:29:16'),
      updateUser?: string(name='UpdateUser', example='111'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='428DCC0D-3C63-5306-BD1B-124396AB97BE'),
  size?: int32(name='Size', example='10'),
  success?: boolean(name='Success', example='true'),
  total?: int32(name='Total', example='20'),
}

model ListAsyncTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAsyncTasksResponseBody(name='body'),
}

/**
 * @summary 查询任务列表
 *
 * @param tmpReq ListAsyncTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAsyncTasksResponse
 */
async function listAsyncTasksWithOptions(tmpReq: ListAsyncTasksRequest, runtime: $RuntimeOptions): ListAsyncTasksResponse {
  tmpReq.validate();
  var request = new ListAsyncTasksShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.taskStatusList)) {
    request.taskStatusListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.taskStatusList, 'TaskStatusList', 'json');
  }
  if (!$isNull(tmpReq.taskTypeList)) {
    request.taskTypeListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.taskTypeList, 'TaskTypeList', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.createTimeEnd)) {
    body['CreateTimeEnd'] = request.createTimeEnd;
  }
  if (!$isNull(request.createTimeStart)) {
    body['CreateTimeStart'] = request.createTimeStart;
  }
  if (!$isNull(request.current)) {
    body['Current'] = request.current;
  }
  if (!$isNull(request.size)) {
    body['Size'] = request.size;
  }
  if (!$isNull(request.taskCode)) {
    body['TaskCode'] = request.taskCode;
  }
  if (!$isNull(request.taskName)) {
    body['TaskName'] = request.taskName;
  }
  if (!$isNull(request.taskStatus)) {
    body['TaskStatus'] = request.taskStatus;
  }
  if (!$isNull(request.taskStatusListShrink)) {
    body['TaskStatusList'] = request.taskStatusListShrink;
  }
  if (!$isNull(request.taskType)) {
    body['TaskType'] = request.taskType;
  }
  if (!$isNull(request.taskTypeListShrink)) {
    body['TaskTypeList'] = request.taskTypeListShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAsyncTasks',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询任务列表
 *
 * @param request ListAsyncTasksRequest
 * @return ListAsyncTasksResponse
 */
async function listAsyncTasks(request: ListAsyncTasksRequest): ListAsyncTasksResponse {
  var runtime = new $RuntimeOptions{};
  return listAsyncTasksWithOptions(request, runtime);
}

model ListBuildConfigsRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='cd327c3d5d5e44159cc716e23bfa530e_p_beebot_public'),
  regionId?: string(name='RegionId'),
  type?: string(name='Type', example='media'),
}

model ListBuildConfigsResponseBody = {
  code?: string(name='Code', example='200'),
  data?: [ 
    {
      buildIn?: boolean(name='BuildIn', example='true'),
      createTime?: string(name='CreateTime', example='2023-04-11 06:14:07'),
      createUser?: string(name='CreateUser', example='1'),
      id?: long(name='Id'),
      keywords?: [ 
        {
          description?: string(name='Description'),
          key?: string(name='Key'),
        }
      ](name='Keywords'),
      tag?: string(name='Tag', example='writingStyle'),
      tagDescription?: string(name='TagDescription'),
      type?: string(name='Type', example='media'),
      updateTime?: string(name='UpdateTime', example='2023-04-11 06:14:07'),
      updateUser?: string(name='UpdateUser', example='1'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Success'),
  requestId?: string(name='RequestId', example='DA021073-17CE-5CCF-9FEB-93226C766887'),
  success?: boolean(name='Success', example='true'),
}

model ListBuildConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBuildConfigsResponseBody(name='body'),
}

/**
 * @summary 获取系统自定义预设
 *
 * @param request ListBuildConfigsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBuildConfigsResponse
 */
async function listBuildConfigsWithOptions(request: ListBuildConfigsRequest, runtime: $RuntimeOptions): ListBuildConfigsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  if (!$isNull(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListBuildConfigs',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取系统自定义预设
 *
 * @param request ListBuildConfigsRequest
 * @return ListBuildConfigsResponse
 */
async function listBuildConfigs(request: ListBuildConfigsRequest): ListBuildConfigsResponse {
  var runtime = new $RuntimeOptions{};
  return listBuildConfigsWithOptions(request, runtime);
}

model ListCustomTextRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  commodityCode?: string(name='CommodityCode', example='商品code'),
}

model ListCustomTextResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      content?: string(name='Content', example='内容'),
      createTime?: string(name='CreateTime', example='创建时间'),
      createUser?: string(name='CreateUser', example='创建用户'),
      id?: long(name='Id', example='40'),
      title?: string(name='Title', example='标题'),
      updateTime?: string(name='UpdateTime', example='修改时间'),
      updateUser?: string(name='UpdateUser', example='修改用户'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model ListCustomTextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCustomTextResponseBody(name='body'),
}

/**
 * @summary 自定义文本列表
 *
 * @param request ListCustomTextRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCustomTextResponse
 */
async function listCustomTextWithOptions(request: ListCustomTextRequest, runtime: $RuntimeOptions): ListCustomTextResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.commodityCode)) {
    body['CommodityCode'] = request.commodityCode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCustomText',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 自定义文本列表
 *
 * @param request ListCustomTextRequest
 * @return ListCustomTextResponse
 */
async function listCustomText(request: ListCustomTextRequest): ListCustomTextResponse {
  var runtime = new $RuntimeOptions{};
  return listCustomTextWithOptions(request, runtime);
}

model ListCustomViewPointsRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  attitude?: string(name='Attitude', example='观点'),
  attitudes?: [ string ](name='Attitudes', example='观点
     *'),
  customViewPointId?: string(name='CustomViewPointId', example='461591f4880747f890702c1b90494d1a'),
  customViewPointIds?: [ string ](name='CustomViewPointIds', example='7ece3d1212e04c9ca716ae2486228f3f'),
  maxResults?: int32(name='MaxResults', example='52'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  topic?: string(name='Topic', example='热榜主题'),
  topicId?: string(name='TopicId', example='1d20ed14db0840efb1c7eaaf4d46352b'),
}

model ListCustomViewPointsShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  attitude?: string(name='Attitude', example='观点'),
  attitudesShrink?: string(name='Attitudes', example='观点
     *'),
  customViewPointId?: string(name='CustomViewPointId', example='461591f4880747f890702c1b90494d1a'),
  customViewPointIdsShrink?: string(name='CustomViewPointIds', example='7ece3d1212e04c9ca716ae2486228f3f'),
  maxResults?: int32(name='MaxResults', example='52'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  topic?: string(name='Topic', example='热榜主题'),
  topicId?: string(name='TopicId', example='1d20ed14db0840efb1c7eaaf4d46352b'),
}

model ListCustomViewPointsResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      asyncTaskId?: string(name='AsyncTaskId', example='2323ac73e174428a98c91097a59c67e0'),
      attitude?: string(name='Attitude', example='观点'),
      createTime?: string(name='CreateTime', example='2024-08-15 16:18:59'),
      createUser?: string(name='CreateUser', example='1'),
      id?: string(name='Id', example='709806dd051042d5ab9de8bdbb3a64ca'),
      status?: string(name='Status', example='RUNNING'),
      taskErrorMessage?: string(name='TaskErrorMessage', example='参数校验失败'),
      taskStatus?: int32(name='TaskStatus', example='1'),
      viewPoints?: [ 
        {
          outlines?: [ 
            {
              outline?: string(name='Outline', example='大纲'),
              summary?: string(name='Summary', example='大纲摘要'),
            }
          ](name='Outlines'),
          point?: string(name='Point', example='视角'),
          summary?: string(name='Summary', example='摘要'),
        }
      ](name='ViewPoints'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='60'),
  message?: string(name='Message', example='success'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='73'),
}

model ListCustomViewPointsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCustomViewPointsResponseBody(name='body'),
}

/**
 * @summary 自定义视角列表
 *
 * @param tmpReq ListCustomViewPointsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCustomViewPointsResponse
 */
async function listCustomViewPointsWithOptions(tmpReq: ListCustomViewPointsRequest, runtime: $RuntimeOptions): ListCustomViewPointsResponse {
  tmpReq.validate();
  var request = new ListCustomViewPointsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.attitudes)) {
    request.attitudesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.attitudes, 'Attitudes', 'json');
  }
  if (!$isNull(tmpReq.customViewPointIds)) {
    request.customViewPointIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.customViewPointIds, 'CustomViewPointIds', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.attitude)) {
    body['Attitude'] = request.attitude;
  }
  if (!$isNull(request.attitudesShrink)) {
    body['Attitudes'] = request.attitudesShrink;
  }
  if (!$isNull(request.customViewPointId)) {
    body['CustomViewPointId'] = request.customViewPointId;
  }
  if (!$isNull(request.customViewPointIdsShrink)) {
    body['CustomViewPointIds'] = request.customViewPointIdsShrink;
  }
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  if (!$isNull(request.topicId)) {
    body['TopicId'] = request.topicId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCustomViewPoints',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 自定义视角列表
 *
 * @param request ListCustomViewPointsRequest
 * @return ListCustomViewPointsResponse
 */
async function listCustomViewPoints(request: ListCustomViewPointsRequest): ListCustomViewPointsResponse {
  var runtime = new $RuntimeOptions{};
  return listCustomViewPointsWithOptions(request, runtime);
}

model ListDatasetDocumentsRequest {
  datasetDescription?: string(name='DatasetDescription', example='xx'),
  datasetId?: long(name='DatasetId', example='1'),
  datasetName?: string(name='DatasetName', example='数据集名称'),
  docType?: string(name='DocType', example='text'),
  excludeFields?: [ string ](name='ExcludeFields'),
  includeFields?: [ string ](name='IncludeFields'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  query?: string(name='Query', example='搜索条件'),
  status?: int32(name='Status', example='100'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model ListDatasetDocumentsShrinkRequest {
  datasetDescription?: string(name='DatasetDescription', example='xx'),
  datasetId?: long(name='DatasetId', example='1'),
  datasetName?: string(name='DatasetName', example='数据集名称'),
  docType?: string(name='DocType', example='text'),
  excludeFieldsShrink?: string(name='ExcludeFields'),
  includeFieldsShrink?: string(name='IncludeFields'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  query?: string(name='Query', example='搜索条件'),
  status?: int32(name='Status', example='100'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model ListDatasetDocumentsResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      categoryUuid?: string(name='CategoryUuid', example='xx'),
      content?: string(name='Content', example='xx'),
      disableHandleMultimodalMedia?: boolean(name='DisableHandleMultimodalMedia', example='false'),
      docId?: string(name='DocId', example='xx'),
      docType?: string(name='DocType', example='text'),
      docUuid?: string(name='DocUuid', example='内部文档唯一ID'),
      extend1?: string(name='Extend1', example='xx'),
      extend2?: string(name='Extend2', example='xx'),
      extend3?: string(name='Extend3', example='xx'),
      multimodalMedias?: [ 
        {
          fileUrl?: string(name='FileUrl', example='图片或视频文件地址'),
          mediaId?: string(name='MediaId', example='多模态数据唯一标识'),
          mediaType?: string(name='MediaType', example='多模态数据类型'),
        }
      ](name='MultimodalMedias'),
      pubTime?: string(name='PubTime', example='2022-01-01 00:00:00'),
      sourceFrom?: string(name='SourceFrom', example='来源'),
      status?: int32(name='Status', example='100'),
      summary?: string(name='Summary', example='xx'),
      title?: string(name='Title', example='xx'),
      url?: string(name='Url', description='url', example='https://xxx/xx'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='100'),
}

model ListDatasetDocumentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDatasetDocumentsResponseBody(name='body'),
}

/**
 * @summary 查询数据集文档列表
 *
 * @param tmpReq ListDatasetDocumentsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDatasetDocumentsResponse
 */
async function listDatasetDocumentsWithOptions(tmpReq: ListDatasetDocumentsRequest, runtime: $RuntimeOptions): ListDatasetDocumentsResponse {
  tmpReq.validate();
  var request = new ListDatasetDocumentsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.excludeFields)) {
    request.excludeFieldsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.excludeFields, 'ExcludeFields', 'json');
  }
  if (!$isNull(tmpReq.includeFields)) {
    request.includeFieldsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.includeFields, 'IncludeFields', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.datasetDescription)) {
    body['DatasetDescription'] = request.datasetDescription;
  }
  if (!$isNull(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!$isNull(request.datasetName)) {
    body['DatasetName'] = request.datasetName;
  }
  if (!$isNull(request.docType)) {
    body['DocType'] = request.docType;
  }
  if (!$isNull(request.excludeFieldsShrink)) {
    body['ExcludeFields'] = request.excludeFieldsShrink;
  }
  if (!$isNull(request.includeFieldsShrink)) {
    body['IncludeFields'] = request.includeFieldsShrink;
  }
  if (!$isNull(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.query)) {
    body['Query'] = request.query;
  }
  if (!$isNull(request.status)) {
    body['Status'] = request.status;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDatasetDocuments',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询数据集文档列表
 *
 * @param request ListDatasetDocumentsRequest
 * @return ListDatasetDocumentsResponse
 */
async function listDatasetDocuments(request: ListDatasetDocumentsRequest): ListDatasetDocumentsResponse {
  var runtime = new $RuntimeOptions{};
  return listDatasetDocumentsWithOptions(request, runtime);
}

model ListDatasetsRequest {
  datasetId?: long(name='DatasetId', example='1'),
  datasetName?: string(name='DatasetName', example='businessDataset'),
  datasetType?: string(name='DatasetType', example='CustomSemanticSearch'),
  endTime?: string(name='EndTime', example='创建时间-结束'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='10'),
  searchDatasetEnable?: int32(name='SearchDatasetEnable', example='3'),
  startTime?: string(name='StartTime', example='创建时间-开始'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model ListDatasetsResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      createTime?: string(name='CreateTime', example='2024-11-12 21:46:24'),
      createUser?: string(name='CreateUser', example='xxx'),
      datasetDescription?: string(name='DatasetDescription', example='xxx'),
      datasetId?: long(name='DatasetId', example='1'),
      datasetName?: string(name='DatasetName', example='xxx'),
      datasetType?: string(name='DatasetType', example='CustomSemanticSearch'),
      searchDatasetEnable?: int32(name='SearchDatasetEnable', example='1'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='100'),
}

model ListDatasetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDatasetsResponseBody(name='body'),
}

/**
 * @summary 数据集管理-查询
 *
 * @param request ListDatasetsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDatasetsResponse
 */
async function listDatasetsWithOptions(request: ListDatasetsRequest, runtime: $RuntimeOptions): ListDatasetsResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!$isNull(request.datasetName)) {
    body['DatasetName'] = request.datasetName;
  }
  if (!$isNull(request.datasetType)) {
    body['DatasetType'] = request.datasetType;
  }
  if (!$isNull(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!$isNull(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.searchDatasetEnable)) {
    body['SearchDatasetEnable'] = request.searchDatasetEnable;
  }
  if (!$isNull(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDatasets',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 数据集管理-查询
 *
 * @param request ListDatasetsRequest
 * @return ListDatasetsResponse
 */
async function listDatasets(request: ListDatasetsRequest): ListDatasetsResponse {
  var runtime = new $RuntimeOptions{};
  return listDatasetsWithOptions(request, runtime);
}

model ListDialoguesRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  current?: int32(name='Current', example='1'),
  dialogueType?: int32(name='DialogueType', example='2'),
  endTime?: string(name='EndTime', example='2024-01-04 11:46:07'),
  size?: int32(name='Size', example='10'),
  startTime?: string(name='StartTime', example='2024-01-04 11:46:07'),
  taskId?: string(name='TaskId', example='xxx'),
}

model ListDialoguesResponseBody = {
  code?: string(name='Code', example='NoData'),
  current?: int32(name='Current', example='1'),
  data?: [ 
    {
      bot?: string(name='Bot', example='xx'),
      createTime?: string(name='CreateTime', example='2024-01-04 11:46:07'),
      createUser?: string(name='CreateUser', example='xx'),
      dialogueType?: int32(name='DialogueType', example='2'),
      taskId?: string(name='TaskId', example='xx'),
      user?: string(name='User', example='x'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  size?: int32(name='Size', example='10'),
  success?: boolean(name='Success', example='true'),
  total?: int32(name='Total', example='100'),
}

model ListDialoguesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDialoguesResponseBody(name='body'),
}

/**
 * @summary 生成历史列表
 *
 * @param request ListDialoguesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDialoguesResponse
 */
async function listDialoguesWithOptions(request: ListDialoguesRequest, runtime: $RuntimeOptions): ListDialoguesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.current)) {
    body['Current'] = request.current;
  }
  if (!$isNull(request.dialogueType)) {
    body['DialogueType'] = request.dialogueType;
  }
  if (!$isNull(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!$isNull(request.size)) {
    body['Size'] = request.size;
  }
  if (!$isNull(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDialogues',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 生成历史列表
 *
 * @param request ListDialoguesRequest
 * @return ListDialoguesResponse
 */
async function listDialogues(request: ListDialoguesRequest): ListDialoguesResponse {
  var runtime = new $RuntimeOptions{};
  return listDialoguesWithOptions(request, runtime);
}

model ListDocsRequest {
  categoryId?: string(name='CategoryId', example='default'),
  docName?: string(name='DocName'),
  docType?: string(name='DocType', example='pdf'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='52a33dc83779f63641e16f5146cd7125'),
  skip?: int32(name='Skip', example='10'),
  statuses?: [ int32 ](name='Statuses'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model ListDocsShrinkRequest {
  categoryId?: string(name='CategoryId', example='default'),
  docName?: string(name='DocName'),
  docType?: string(name='DocType', example='pdf'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='52a33dc83779f63641e16f5146cd7125'),
  skip?: int32(name='Skip', example='10'),
  statusesShrink?: string(name='Statuses'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model ListDocsResponseBody = {
  code?: string(name='Code', example='successful'),
  data?: [ 
    {
      categoryId?: string(name='CategoryId', example='default'),
      createTime?: long(name='CreateTime', example='2024-01-04 11:46:07'),
      docId?: string(name='DocId', example='12345'),
      docName?: string(name='DocName'),
      docType?: string(name='DocType', example='pdf'),
      status?: int32(name='Status', example='0'),
      statusMessage?: string(name='StatusMessage'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='10'),
  message?: string(name='Message', example='successful'),
  nextToken?: string(name='NextToken', example='CAESGgoSChAKDGNvbXBsZXRlVGltZRABCgQiAggAGAAiQAoJANEQ4mYAAAAACjMDLgAAADFTNzMyZDMwMzAzMDM4NzA3MjZjN2E2NDYyNzUzODMxMzY3ODM0NmIzNTZkNjc='),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='70'),
}

model ListDocsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDocsResponseBody(name='body'),
}

/**
 * @summary 妙读获取文档列表
 *
 * @param tmpReq ListDocsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDocsResponse
 */
async function listDocsWithOptions(tmpReq: ListDocsRequest, runtime: $RuntimeOptions): ListDocsResponse {
  tmpReq.validate();
  var request = new ListDocsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.statuses)) {
    request.statusesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.statuses, 'Statuses', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.categoryId)) {
    body['CategoryId'] = request.categoryId;
  }
  if (!$isNull(request.docName)) {
    body['DocName'] = request.docName;
  }
  if (!$isNull(request.docType)) {
    body['DocType'] = request.docType;
  }
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.skip)) {
    body['Skip'] = request.skip;
  }
  if (!$isNull(request.statusesShrink)) {
    body['Statuses'] = request.statusesShrink;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListDocs',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读获取文档列表
 *
 * @param request ListDocsRequest
 * @return ListDocsResponse
 */
async function listDocs(request: ListDocsRequest): ListDocsResponse {
  var runtime = new $RuntimeOptions{};
  return listDocsWithOptions(request, runtime);
}

model ListFreshViewPointsRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  maxResults?: int32(name='MaxResults', example='6'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  topic?: string(name='Topic', description='This parameter is required.', example='热榜主题'),
  topicSource?: string(name='TopicSource', description='This parameter is required.', example='热榜源'),
}

model ListFreshViewPointsResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      outlines?: [ 
        {
          outline?: string(name='Outline', example='大纲'),
          summary?: string(name='Summary', example='大纲摘要'),
        }
      ](name='Outlines'),
      point?: string(name='Point', example='视角'),
      summary?: string(name='Summary', example='摘要'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='94'),
  message?: string(name='Message', example='success'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='26'),
}

model ListFreshViewPointsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFreshViewPointsResponseBody(name='body'),
}

/**
 * @summary 新颖视角列表
 *
 * @param request ListFreshViewPointsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFreshViewPointsResponse
 */
async function listFreshViewPointsWithOptions(request: ListFreshViewPointsRequest, runtime: $RuntimeOptions): ListFreshViewPointsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  if (!$isNull(request.topicSource)) {
    body['TopicSource'] = request.topicSource;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListFreshViewPoints',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新颖视角列表
 *
 * @param request ListFreshViewPointsRequest
 * @return ListFreshViewPointsResponse
 */
async function listFreshViewPoints(request: ListFreshViewPointsRequest): ListFreshViewPointsResponse {
  var runtime = new $RuntimeOptions{};
  return listFreshViewPointsWithOptions(request, runtime);
}

model ListGeneratedContentsRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  contentDomain?: string(name='ContentDomain', example='media'),
  current?: int32(name='Current', example='1'),
  endTime?: string(name='EndTime', example='2024-01-04 11:46:07'),
  query?: string(name='Query'),
  size?: int32(name='Size', example='10'),
  startTime?: string(name='StartTime', example='2024-01-04 11:46:07'),
  taskId?: string(name='TaskId'),
  title?: string(name='Title'),
}

model ListGeneratedContentsResponseBody = {
  code?: string(name='Code', example='NoData'),
  current?: int32(name='Current', example='1'),
  data?: [ 
    {
      content?: string(name='Content'),
      contentDomain?: string(name='ContentDomain', example='media'),
      contentText?: string(name='ContentText'),
      createTime?: string(name='CreateTime', example='2024-01-04 11:46:07'),
      createUser?: string(name='CreateUser', example='123'),
      deviceId?: string(name='DeviceId', example='xxx'),
      id?: long(name='Id', example='10'),
      keywordList?: [ string ](name='KeywordList'),
      keywords?: string(name='Keywords'),
      prompt?: string(name='Prompt'),
      taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
      title?: string(name='Title'),
      updateTime?: string(name='UpdateTime', example='2024-01-04 11:46:07'),
      updateUser?: string(name='UpdateUser', example='1111'),
      uuid?: string(name='Uuid', example='xxx'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  size?: int32(name='Size', example='10'),
  success?: boolean(name='Success', example='true'),
  total?: int32(name='Total', example='100'),
}

model ListGeneratedContentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListGeneratedContentsResponseBody(name='body'),
}

/**
 * @summary 文档管理-列表。
 *
 * @param request ListGeneratedContentsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListGeneratedContentsResponse
 */
async function listGeneratedContentsWithOptions(request: ListGeneratedContentsRequest, runtime: $RuntimeOptions): ListGeneratedContentsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.contentDomain)) {
    body['ContentDomain'] = request.contentDomain;
  }
  if (!$isNull(request.current)) {
    body['Current'] = request.current;
  }
  if (!$isNull(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!$isNull(request.query)) {
    body['Query'] = request.query;
  }
  if (!$isNull(request.size)) {
    body['Size'] = request.size;
  }
  if (!$isNull(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.title)) {
    body['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListGeneratedContents',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档管理-列表。
 *
 * @param request ListGeneratedContentsRequest
 * @return ListGeneratedContentsResponse
 */
async function listGeneratedContents(request: ListGeneratedContentsRequest): ListGeneratedContentsResponse {
  var runtime = new $RuntimeOptions{};
  return listGeneratedContentsWithOptions(request, runtime);
}

model ListHotNewsWithTypeRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
  current?: int32(name='Current', example='1'),
  newsType?: string(name='NewsType', example='society'),
  newsTypes?: [ string ](name='NewsTypes'),
  size?: int32(name='Size', example='10'),
}

model ListHotNewsWithTypeShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
  current?: int32(name='Current', example='1'),
  newsType?: string(name='NewsType', example='society'),
  newsTypesShrink?: string(name='NewsTypes'),
  size?: int32(name='Size', example='10'),
}

model ListHotNewsWithTypeResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  data?: [ 
    {
      news?: [ 
        {
          author?: string(name='Author'),
          content?: string(name='Content'),
          docUuid?: string(name='DocUuid', example='3f7045e099474ba28ceca1b4eb6d6e21'),
          imageUrls?: [ string ](name='ImageUrls'),
          pubTime?: string(name='PubTime', example='2023-04-11 06:14:07'),
          searchSource?: string(name='SearchSource'),
          searchSourceName?: string(name='SearchSourceName'),
          source?: string(name='Source'),
          summary?: string(name='Summary'),
          tag?: string(name='Tag'),
          title?: string(name='Title'),
          updateTime?: string(name='UpdateTime', example='2023-10-14 14:30:00'),
          url?: string(name='Url', example='http://xxxxx/xxx'),
        }
      ](name='News'),
      newsType?: string(name='NewsType', example='society'),
      newsTypeName?: string(name='NewsTypeName'),
      totalPages?: int32(name='TotalPages', example='77'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='数据不存在'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='true'),
}

model ListHotNewsWithTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHotNewsWithTypeResponseBody(name='body'),
}

/**
 * @summary 获取分类的热点新闻
 *
 * @param tmpReq ListHotNewsWithTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHotNewsWithTypeResponse
 */
async function listHotNewsWithTypeWithOptions(tmpReq: ListHotNewsWithTypeRequest, runtime: $RuntimeOptions): ListHotNewsWithTypeResponse {
  tmpReq.validate();
  var request = new ListHotNewsWithTypeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.newsTypes)) {
    request.newsTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.newsTypes, 'NewsTypes', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.current)) {
    body['Current'] = request.current;
  }
  if (!$isNull(request.newsType)) {
    body['NewsType'] = request.newsType;
  }
  if (!$isNull(request.newsTypesShrink)) {
    body['NewsTypes'] = request.newsTypesShrink;
  }
  if (!$isNull(request.size)) {
    body['Size'] = request.size;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListHotNewsWithType',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取分类的热点新闻
 *
 * @param request ListHotNewsWithTypeRequest
 * @return ListHotNewsWithTypeResponse
 */
async function listHotNewsWithType(request: ListHotNewsWithTypeRequest): ListHotNewsWithTypeResponse {
  var runtime = new $RuntimeOptions{};
  return listHotNewsWithTypeWithOptions(request, runtime);
}

model ListHotSourcesRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  maxResults?: int32(name='MaxResults', example='66'),
  nextToken?: string(name='NextToken', example='下一页的token'),
}

model ListHotSourcesResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      description?: string(name='Description', example='热榜源描述'),
      show?: boolean(name='Show', example='true'),
      sort?: int32(name='Sort', example='86'),
      source?: string(name='Source', example='热榜源标识'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='4'),
  message?: string(name='Message', example='success'),
  nextToken?: string(name='NextToken', example='xxxxxx'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='30'),
}

model ListHotSourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHotSourcesResponseBody(name='body'),
}

/**
 * @summary 获取所有平台热榜源列表
 *
 * @param request ListHotSourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHotSourcesResponse
 */
async function listHotSourcesWithOptions(request: ListHotSourcesRequest, runtime: $RuntimeOptions): ListHotSourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListHotSources',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取所有平台热榜源列表
 *
 * @param request ListHotSourcesRequest
 * @return ListHotSourcesResponse
 */
async function listHotSources(request: ListHotSourcesRequest): ListHotSourcesResponse {
  var runtime = new $RuntimeOptions{};
  return listHotSourcesWithOptions(request, runtime);
}

model ListHotTopicsRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  maxResults?: int32(name='MaxResults', example='1'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  topicIds?: [ string ](name='TopicIds'),
  topicQuery?: string(name='TopicQuery', example='根据热榜主题全文检索'),
  topicSource?: string(name='TopicSource', example='热榜源筛选，支持的热榜源。热榜源详见API：ListHotSources'),
  topicVersion?: string(name='TopicVersion', example='数据版本筛选'),
  topics?: [ string ](name='Topics'),
  withNews?: boolean(name='WithNews', example='true'),
}

model ListHotTopicsShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  maxResults?: int32(name='MaxResults', example='1'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  topicIdsShrink?: string(name='TopicIds'),
  topicQuery?: string(name='TopicQuery', example='根据热榜主题全文检索'),
  topicSource?: string(name='TopicSource', example='热榜源筛选，支持的热榜源。热榜源详见API：ListHotSources'),
  topicVersion?: string(name='TopicVersion', example='数据版本筛选'),
  topicsShrink?: string(name='Topics'),
  withNews?: boolean(name='WithNews', example='true'),
}

model ListHotTopicsResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      asyncTaskId?: string(name='AsyncTaskId', example='异步任务ID（自定义主题场景下使用）'),
      createUser?: string(name='CreateUser', example='创建用户ID（自定义主题场景下使用）'),
      hotValue?: long(name='HotValue', example='61'),
      id?: string(name='Id', example='热榜ID'),
      status?: string(name='Status', example='FAILED'),
      structureSummary?: [ 
        {
          docList?: [ 
            {
              source?: string(name='Source'),
              title?: string(name='Title', example='xxxxx'),
              url?: string(name='Url', example='http://www.example.com'),
            }
          ](name='DocList'),
          summary?: string(name='Summary', example='摘要'),
          title?: string(name='Title', example='标题'),
        }
      ](name='StructureSummary'),
      summary?: string(name='Summary', example='热榜摘要'),
      taskErrorMessage?: string(name='TaskErrorMessage', example='异步任务失败错误信息'),
      taskStatus?: int32(name='TaskStatus', example='26'),
      topic?: string(name='Topic', example='主题唯一名称'),
      topicSource?: string(name='TopicSource', example='热榜源，目前支持的热榜源: Toutiao：头条、Quark：夸克、Baidu：百度、Sina：新浪。Custom：自定义、Aggregation：热点话题榜'),
      version?: string(name='Version', example='数据版本'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='94'),
  message?: string(name='Message', example='success'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='23'),
}

model ListHotTopicsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHotTopicsResponseBody(name='body'),
}

/**
 * @summary 获取热点事件列表
 *
 * @param tmpReq ListHotTopicsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHotTopicsResponse
 */
async function listHotTopicsWithOptions(tmpReq: ListHotTopicsRequest, runtime: $RuntimeOptions): ListHotTopicsResponse {
  tmpReq.validate();
  var request = new ListHotTopicsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.topicIds)) {
    request.topicIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.topicIds, 'TopicIds', 'json');
  }
  if (!$isNull(tmpReq.topics)) {
    request.topicsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.topics, 'Topics', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.topicIdsShrink)) {
    body['TopicIds'] = request.topicIdsShrink;
  }
  if (!$isNull(request.topicQuery)) {
    body['TopicQuery'] = request.topicQuery;
  }
  if (!$isNull(request.topicSource)) {
    body['TopicSource'] = request.topicSource;
  }
  if (!$isNull(request.topicVersion)) {
    body['TopicVersion'] = request.topicVersion;
  }
  if (!$isNull(request.topicsShrink)) {
    body['Topics'] = request.topicsShrink;
  }
  if (!$isNull(request.withNews)) {
    body['WithNews'] = request.withNews;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListHotTopics',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取热点事件列表
 *
 * @param request ListHotTopicsRequest
 * @return ListHotTopicsResponse
 */
async function listHotTopics(request: ListHotTopicsRequest): ListHotTopicsResponse {
  var runtime = new $RuntimeOptions{};
  return listHotTopicsWithOptions(request, runtime);
}

model ListHotViewPointsRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  maxResults?: int32(name='MaxResults', example='56'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  topic?: string(name='Topic', description='This parameter is required.', example='热榜主题'),
  topicSource?: string(name='TopicSource', description='This parameter is required.', example='热榜源'),
}

model ListHotViewPointsResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      attitude?: string(name='Attitude', example='当前观点'),
      attitudeType?: string(name='AttitudeType', example='观点类型'),
      news?: [ 
        {
          author?: string(name='Author', example='作者'),
          content?: string(name='Content', example='文章内容'),
          docId?: string(name='DocId', example='xxxxx'),
          docUuid?: string(name='DocUuid', example='123456'),
          imageUrls?: [ string ](name='ImageUrls', example='https://www.example.com/aaa.png'),
          pubTime?: string(name='PubTime', example='2024-01-22 10:29:00'),
          source?: string(name='Source', example='新浪'),
          summary?: string(name='Summary', example='文章摘要'),
          tags?: [ string ](name='Tags', example='["标签1","标签2"]'),
          title?: string(name='Title', example='文章标题'),
          topic?: string(name='Topic', example='文章主题'),
          url?: string(name='Url', example='https://www.example.com/aaa.docx'),
        }
      ](name='News'),
      ratio?: string(name='Ratio', example='当前观点占比'),
      viewPoints?: [ 
        {
          outlines?: [ 
            {
              outline?: string(name='Outline', example='大纲'),
              summary?: string(name='Summary', example='大纲摘要'),
            }
          ](name='Outlines'),
          point?: string(name='Point', example='视角'),
          summary?: string(name='Summary', example='摘要'),
        }
      ](name='ViewPoints'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='67'),
  message?: string(name='Message', example='success'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='70'),
}

model ListHotViewPointsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHotViewPointsResponseBody(name='body'),
}

/**
 * @summary 热门视角列表
 *
 * @param request ListHotViewPointsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHotViewPointsResponse
 */
async function listHotViewPointsWithOptions(request: ListHotViewPointsRequest, runtime: $RuntimeOptions): ListHotViewPointsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  if (!$isNull(request.topicSource)) {
    body['TopicSource'] = request.topicSource;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListHotViewPoints',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 热门视角列表
 *
 * @param request ListHotViewPointsRequest
 * @return ListHotViewPointsResponse
 */
async function listHotViewPoints(request: ListHotViewPointsRequest): ListHotViewPointsResponse {
  var runtime = new $RuntimeOptions{};
  return listHotViewPointsWithOptions(request, runtime);
}

model ListInterveneCntRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='fcb14f25c9ee41ccad33a049de8f941b_p_outbound_public'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListInterveneCntResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    cntList?: [ any ](name='CntList'),
    pageCnt?: int32(name='PageCnt', example='10'),
    pageIndex?: int32(name='PageIndex', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='true'),
}

model ListInterveneCntResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInterveneCntResponseBody(name='body'),
}

/**
 * @summary 获得干预项目数量列表
 *
 * @param request ListInterveneCntRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInterveneCntResponse
 */
async function listInterveneCntWithOptions(request: ListInterveneCntRequest, runtime: $RuntimeOptions): ListInterveneCntResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListInterveneCnt',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获得干预项目数量列表
 *
 * @param request ListInterveneCntRequest
 * @return ListInterveneCntResponse
 */
async function listInterveneCnt(request: ListInterveneCntRequest): ListInterveneCntResponse {
  var runtime = new $RuntimeOptions{};
  return listInterveneCntWithOptions(request, runtime);
}

model ListInterveneImportTasksRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
}

model ListInterveneImportTasksResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  data?: {
    pageIndex?: int32(name='PageIndex', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    statusList?: [ 
      {
        msg?: string(name='Msg', example='Success'),
        percentage?: int32(name='Percentage', example='5'),
        status?: int32(name='Status', example='Success'),
        taskId?: string(name='TaskId', example='4854'),
        taskName?: string(name='TaskName', example='12344454'),
      }
    ](name='StatusList'),
    totalSize?: int32(name='TotalSize', example='0'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='true'),
}

model ListInterveneImportTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInterveneImportTasksResponseBody(name='body'),
}

/**
 * @summary 获得导入任务列表
 *
 * @param request ListInterveneImportTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInterveneImportTasksResponse
 */
async function listInterveneImportTasksWithOptions(request: ListInterveneImportTasksRequest, runtime: $RuntimeOptions): ListInterveneImportTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListInterveneImportTasks',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获得导入任务列表
 *
 * @param request ListInterveneImportTasksRequest
 * @return ListInterveneImportTasksResponse
 */
async function listInterveneImportTasks(request: ListInterveneImportTasksRequest): ListInterveneImportTasksResponse {
  var runtime = new $RuntimeOptions{};
  return listInterveneImportTasksWithOptions(request, runtime);
}

model ListInterveneRulesRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListInterveneRulesResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    count?: long(name='Count', example='1'),
    interveneRuleList?: [ 
      {
        answerConfig?: [ 
          {
            answerType?: int32(name='AnswerType', example='0'),
            message?: string(name='Message'),
            namespace?: string(name='Namespace', example='namespace_qa_query'),
          }
        ](name='AnswerConfig'),
        createTime?: string(name='CreateTime', example='2023-06-05 15:17:01'),
        effectTime?: string(name='EffectTime', example='2023-04-03 02:42:01'),
        interveneType?: int32(name='InterveneType', example='0'),
        namespaceList?: [ string ](name='NamespaceList'),
        ruleId?: long(name='RuleId', example='mr-iuo9pi9w555phfbb'),
        ruleName?: string(name='RuleName', example='ruletest'),
      }
    ](name='InterveneRuleList'),
    pageIndex?: int32(name='PageIndex', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='DA021073-17CE-5CCF-9FEB-93226C766887'),
  success?: boolean(name='Success', example='true'),
}

model ListInterveneRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInterveneRulesResponseBody(name='body'),
}

/**
 * @summary 获得干预规则列表
 *
 * @param request ListInterveneRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInterveneRulesResponse
 */
async function listInterveneRulesWithOptions(request: ListInterveneRulesRequest, runtime: $RuntimeOptions): ListInterveneRulesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListInterveneRules',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获得干预规则列表
 *
 * @param request ListInterveneRulesRequest
 * @return ListInterveneRulesResponse
 */
async function listInterveneRules(request: ListInterveneRulesRequest): ListInterveneRulesResponse {
  var runtime = new $RuntimeOptions{};
  return listInterveneRulesWithOptions(request, runtime);
}

model ListIntervenesRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='33a2658aaabf4c24b45d50e575125311_p_beebot_public'),
  interveneType?: int32(name='InterveneType'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  query?: string(name='Query'),
  ruleId?: long(name='RuleId', example='mqtt_outRule_1679019634514'),
}

model ListIntervenesResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    interveneList?: [ 
      {
        id?: string(name='Id', description='id', example='36559'),
        query?: string(name='Query'),
      }
    ](name='InterveneList'),
    pageIndex?: int32(name='PageIndex', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalSize?: long(name='TotalSize', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='428DCC0D-3C63-5306-BD1B-124396AB97BE'),
  success?: boolean(name='Success', example='true'),
}

model ListIntervenesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIntervenesResponseBody(name='body'),
}

/**
 * @summary 获得干预项列表
 *
 * @param request ListIntervenesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIntervenesResponse
 */
async function listIntervenesWithOptions(request: ListIntervenesRequest, runtime: $RuntimeOptions): ListIntervenesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.interveneType)) {
    body['InterveneType'] = request.interveneType;
  }
  if (!$isNull(request.pageIndex)) {
    body['PageIndex'] = request.pageIndex;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.query)) {
    body['Query'] = request.query;
  }
  if (!$isNull(request.ruleId)) {
    body['RuleId'] = request.ruleId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListIntervenes',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获得干预项列表
 *
 * @param request ListIntervenesRequest
 * @return ListIntervenesResponse
 */
async function listIntervenes(request: ListIntervenesRequest): ListIntervenesResponse {
  var runtime = new $RuntimeOptions{};
  return listIntervenesWithOptions(request, runtime);
}

model ListMaterialDocumentsRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='33a2658aaabf4c24b45d50e575125311_p_beebot_public'),
  content?: string(name='Content'),
  createTimeEnd?: string(name='CreateTimeEnd', example='2023-03-18 02:00:00'),
  createTimeStart?: string(name='CreateTimeStart', example='2023-02-19 07:28:11'),
  current?: int32(name='Current', example='1'),
  docType?: string(name='DocType', example='jsonLine'),
  docTypeList?: [ string ](name='DocTypeList', example='excel'),
  generatePublicUrl?: boolean(name='GeneratePublicUrl', example='true'),
  id?: long(name='Id', example='69'),
  keywords?: [ string ](name='Keywords'),
  query?: string(name='Query'),
  shareAttr?: int32(name='ShareAttr', example='1'),
  size?: int32(name='Size', example='10'),
  title?: string(name='Title'),
  updateTimeEnd?: string(name='UpdateTimeEnd', example='2023-03-18 03:00:00'),
  updateTimeStart?: string(name='UpdateTimeStart', example='2023-03-18 02:00:00'),
}

model ListMaterialDocumentsShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='33a2658aaabf4c24b45d50e575125311_p_beebot_public'),
  content?: string(name='Content'),
  createTimeEnd?: string(name='CreateTimeEnd', example='2023-03-18 02:00:00'),
  createTimeStart?: string(name='CreateTimeStart', example='2023-02-19 07:28:11'),
  current?: int32(name='Current', example='1'),
  docType?: string(name='DocType', example='jsonLine'),
  docTypeListShrink?: string(name='DocTypeList', example='excel'),
  generatePublicUrl?: boolean(name='GeneratePublicUrl', example='true'),
  id?: long(name='Id', example='69'),
  keywordsShrink?: string(name='Keywords'),
  query?: string(name='Query'),
  shareAttr?: int32(name='ShareAttr', example='1'),
  size?: int32(name='Size', example='10'),
  title?: string(name='Title'),
  updateTimeEnd?: string(name='UpdateTimeEnd', example='2023-03-18 03:00:00'),
  updateTimeStart?: string(name='UpdateTimeStart', example='2023-03-18 02:00:00'),
}

model ListMaterialDocumentsResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  current?: int32(name='Current', example='1'),
  data?: [ 
    {
      author?: string(name='Author'),
      createTime?: string(name='CreateTime', example='2023-03-18 02:00:00'),
      createUser?: string(name='CreateUser', example='1'),
      createUserName?: string(name='CreateUserName'),
      docKeywords?: [ string ](name='DocKeywords'),
      docType?: string(name='DocType', example='pdf'),
      externalUrl?: string(name='ExternalUrl', example='https://www.example.com'),
      htmlContent?: string(name='HtmlContent'),
      id?: long(name='Id', example='35'),
      pubTime?: string(name='PubTime', example='2023-03-18 02:00:00'),
      publicUrl?: string(name='PublicUrl', example='https://www.example.com'),
      shareAttr?: int32(name='ShareAttr', example='1'),
      srcFrom?: string(name='SrcFrom', example='user_upload'),
      summary?: string(name='Summary'),
      textContent?: string(name='TextContent'),
      thumbnailInBase64?: string(name='ThumbnailInBase64'),
      title?: string(name='Title'),
      updateTime?: string(name='UpdateTime', example='2023-03-18 02:00:00'),
      updateUser?: string(name='UpdateUser', example='1'),
      updateUserName?: string(name='UpdateUserName'),
      url?: string(name='Url', example='https://www.example.com'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='数据不存在'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  size?: int32(name='Size', example='10'),
  success?: boolean(name='Success', example='false'),
  total?: int32(name='Total', example='100'),
}

model ListMaterialDocumentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMaterialDocumentsResponseBody(name='body'),
}

/**
 * @summary 查询素材列表
 *
 * @param tmpReq ListMaterialDocumentsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMaterialDocumentsResponse
 */
async function listMaterialDocumentsWithOptions(tmpReq: ListMaterialDocumentsRequest, runtime: $RuntimeOptions): ListMaterialDocumentsResponse {
  tmpReq.validate();
  var request = new ListMaterialDocumentsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.docTypeList)) {
    request.docTypeListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.docTypeList, 'DocTypeList', 'json');
  }
  if (!$isNull(tmpReq.keywords)) {
    request.keywordsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.keywords, 'Keywords', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.content)) {
    body['Content'] = request.content;
  }
  if (!$isNull(request.createTimeEnd)) {
    body['CreateTimeEnd'] = request.createTimeEnd;
  }
  if (!$isNull(request.createTimeStart)) {
    body['CreateTimeStart'] = request.createTimeStart;
  }
  if (!$isNull(request.current)) {
    body['Current'] = request.current;
  }
  if (!$isNull(request.docType)) {
    body['DocType'] = request.docType;
  }
  if (!$isNull(request.docTypeListShrink)) {
    body['DocTypeList'] = request.docTypeListShrink;
  }
  if (!$isNull(request.generatePublicUrl)) {
    body['GeneratePublicUrl'] = request.generatePublicUrl;
  }
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  if (!$isNull(request.keywordsShrink)) {
    body['Keywords'] = request.keywordsShrink;
  }
  if (!$isNull(request.query)) {
    body['Query'] = request.query;
  }
  if (!$isNull(request.shareAttr)) {
    body['ShareAttr'] = request.shareAttr;
  }
  if (!$isNull(request.size)) {
    body['Size'] = request.size;
  }
  if (!$isNull(request.title)) {
    body['Title'] = request.title;
  }
  if (!$isNull(request.updateTimeEnd)) {
    body['UpdateTimeEnd'] = request.updateTimeEnd;
  }
  if (!$isNull(request.updateTimeStart)) {
    body['UpdateTimeStart'] = request.updateTimeStart;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListMaterialDocuments',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询素材列表
 *
 * @param request ListMaterialDocumentsRequest
 * @return ListMaterialDocumentsResponse
 */
async function listMaterialDocuments(request: ListMaterialDocumentsRequest): ListMaterialDocumentsResponse {
  var runtime = new $RuntimeOptions{};
  return listMaterialDocumentsWithOptions(request, runtime);
}

model ListPlanningProposalRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  customViewPointId?: string(name='CustomViewPointId', example='e7b26a9e1211444db8f0a984361a5e0f'),
  customViewPointIds?: [ string ](name='CustomViewPointIds', example='27971fc8f3ce4ed58c7e7fc4b503e432'),
  maxResults?: int32(name='MaxResults', example='73'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  titles?: [ string ](name='Titles', example='标题
     *'),
  topic?: string(name='Topic', description='This parameter is required.', example='热榜主题'),
  topicSource?: string(name='TopicSource', description='This parameter is required.', example='热榜源'),
  topicVersion?: string(name='TopicVersion', example='2024-09-10_08'),
  viewPointType?: string(name='ViewPointType', description='This parameter is required.', example='CustomViewPoints'),
}

model ListPlanningProposalShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  customViewPointId?: string(name='CustomViewPointId', example='e7b26a9e1211444db8f0a984361a5e0f'),
  customViewPointIdsShrink?: string(name='CustomViewPointIds', example='27971fc8f3ce4ed58c7e7fc4b503e432'),
  maxResults?: int32(name='MaxResults', example='73'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  titlesShrink?: string(name='Titles', example='标题
     *'),
  topic?: string(name='Topic', description='This parameter is required.', example='热榜主题'),
  topicSource?: string(name='TopicSource', description='This parameter is required.', example='热榜源'),
  topicVersion?: string(name='TopicVersion', example='2024-09-10_08'),
  viewPointType?: string(name='ViewPointType', description='This parameter is required.', example='CustomViewPoints'),
}

model ListPlanningProposalResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      outlines?: [ 
        {
          outline?: string(name='Outline', example='大纲'),
          summary?: string(name='Summary', example='大纲摘要'),
        }
      ](name='Outlines'),
      summary?: string(name='Summary'),
      title?: string(name='Title'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='77'),
  message?: string(name='Message', example='success'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='80'),
}

model ListPlanningProposalResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPlanningProposalResponseBody(name='body'),
}

/**
 * @summary 获取选题策划列表
 *
 * @param tmpReq ListPlanningProposalRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPlanningProposalResponse
 */
async function listPlanningProposalWithOptions(tmpReq: ListPlanningProposalRequest, runtime: $RuntimeOptions): ListPlanningProposalResponse {
  tmpReq.validate();
  var request = new ListPlanningProposalShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.customViewPointIds)) {
    request.customViewPointIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.customViewPointIds, 'CustomViewPointIds', 'json');
  }
  if (!$isNull(tmpReq.titles)) {
    request.titlesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.titles, 'Titles', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.customViewPointId)) {
    body['CustomViewPointId'] = request.customViewPointId;
  }
  if (!$isNull(request.customViewPointIdsShrink)) {
    body['CustomViewPointIds'] = request.customViewPointIdsShrink;
  }
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.titlesShrink)) {
    body['Titles'] = request.titlesShrink;
  }
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  if (!$isNull(request.topicSource)) {
    body['TopicSource'] = request.topicSource;
  }
  if (!$isNull(request.topicVersion)) {
    body['TopicVersion'] = request.topicVersion;
  }
  if (!$isNull(request.viewPointType)) {
    body['ViewPointType'] = request.viewPointType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPlanningProposal',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取选题策划列表
 *
 * @param request ListPlanningProposalRequest
 * @return ListPlanningProposalResponse
 */
async function listPlanningProposal(request: ListPlanningProposalRequest): ListPlanningProposalResponse {
  var runtime = new $RuntimeOptions{};
  return listPlanningProposalWithOptions(request, runtime);
}

model ListSearchTaskDialogueDatasRequest {
  includeContent?: boolean(name='IncludeContent', example='true'),
  multimodalSearchType?: string(name='MultimodalSearchType', example='text'),
  originalSessionId?: string(name='OriginalSessionId', example='xx'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  query?: string(name='Query', example='xx'),
  searchModel?: string(name='SearchModel', example='ClusterGenerate'),
  searchModelDataValue?: string(name='SearchModelDataValue', example='xxx'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='xx'),
  taskId?: string(name='TaskId', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model ListSearchTaskDialogueDatasResponseBody = {
  articles?: [ 
    {
      author?: string(name='Author', example='作者'),
      categoryUuid?: string(name='CategoryUuid', example='xx'),
      content?: string(name='Content', example='文章内容'),
      docId?: string(name='DocId', example='文档-自定义的唯一ID'),
      docType?: string(name='DocType', example='text'),
      docUuid?: string(name='DocUuid', example='xxx'),
      extend1?: string(name='Extend1', example='xx'),
      extend2?: string(name='Extend2', example='xx'),
      extend3?: string(name='Extend3', example='xx'),
      multimodalMedias?: [ 
        {
          fileUrl?: string(name='FileUrl', example='图片或视频文件地址'),
          mediaId?: string(name='MediaId', example='多模态数据唯一标识'),
          mediaType?: string(name='MediaType', example='多模态数据类型'),
        }
      ](name='MultimodalMedias'),
      pubTime?: string(name='PubTime', example='2024-11-25 14:25:59'),
      source?: string(name='Source', example='新华社'),
      summary?: string(name='Summary', example='文章摘要'),
      title?: string(name='Title', example='文章标题'),
      url?: string(name='Url', example='https://www.example.com/aaa.docx'),
    }
  ](name='Articles'),
  code?: string(name='Code', example='NoData'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  images?: [ 
    {
      fileUrl?: string(name='FileUrl', example='图片或视频文件地址'),
      mediaId?: string(name='MediaId', example='多模态数据唯一标识'),
      mediaType?: string(name='MediaType', example='多模态数据类型'),
    }
  ](name='Images'),
  message?: string(name='Message', example='success'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  realtimeSearch?: boolean(name='RealtimeSearch', example='true'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  searchType?: string(name='SearchType', example='realtime'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='100'),
  videos?: [ 
    {
      fileUrl?: string(name='FileUrl', example='图片或视频文件地址'),
      mediaId?: string(name='MediaId', example='多模态数据唯一标识'),
      mediaType?: string(name='MediaType', example='多模态数据类型'),
    }
  ](name='Videos'),
}

model ListSearchTaskDialogueDatasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSearchTaskDialogueDatasResponseBody(name='body'),
}

/**
 * @summary 查询搜索生成任务对话详情中数据列表
 *
 * @param request ListSearchTaskDialogueDatasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSearchTaskDialogueDatasResponse
 */
async function listSearchTaskDialogueDatasWithOptions(request: ListSearchTaskDialogueDatasRequest, runtime: $RuntimeOptions): ListSearchTaskDialogueDatasResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.includeContent)) {
    body['IncludeContent'] = request.includeContent;
  }
  if (!$isNull(request.multimodalSearchType)) {
    body['MultimodalSearchType'] = request.multimodalSearchType;
  }
  if (!$isNull(request.originalSessionId)) {
    body['OriginalSessionId'] = request.originalSessionId;
  }
  if (!$isNull(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.query)) {
    body['Query'] = request.query;
  }
  if (!$isNull(request.searchModel)) {
    body['SearchModel'] = request.searchModel;
  }
  if (!$isNull(request.searchModelDataValue)) {
    body['SearchModelDataValue'] = request.searchModelDataValue;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSearchTaskDialogueDatas',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询搜索生成任务对话详情中数据列表
 *
 * @param request ListSearchTaskDialogueDatasRequest
 * @return ListSearchTaskDialogueDatasResponse
 */
async function listSearchTaskDialogueDatas(request: ListSearchTaskDialogueDatasRequest): ListSearchTaskDialogueDatasResponse {
  var runtime = new $RuntimeOptions{};
  return listSearchTaskDialogueDatasWithOptions(request, runtime);
}

model ListSearchTaskDialoguesRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  taskId?: string(name='TaskId', example='xxxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model ListSearchTaskDialoguesResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      chatConfig?: {
        dialogueType?: int32(name='DialogueType', example='24'),
        endToEnd?: boolean(name='EndToEnd'),
        generateLevel?: string(name='GenerateLevel', example='concise'),
        generateTechnology?: string(name='GenerateTechnology', example='copilotReference'),
        searchModels?: [ string ](name='SearchModels'),
        searchParam?: {
          endTime?: string(name='EndTime'),
          multimodalSearchTypes?: [ string ](name='MultimodalSearchTypes'),
          searchSources?: [ 
            {
              code?: string(name='Code', example='x\\"x'),
              datasetName?: string(name='DatasetName', example='xx'),
              name?: string(name='Name', example='x'),
            }
          ](name='SearchSources'),
          startTime?: string(name='StartTime'),
        }(name='SearchParam'),
      }(name='ChatConfig'),
      createTime?: string(name='CreateTime', example='2024-11-25 13:33:01'),
      dialogueType?: int32(name='DialogueType', example='24'),
      goodText?: string(name='GoodText', example='xxx'),
      originSessionId?: string(name='OriginSessionId', example='xxxx'),
      prompt?: string(name='Prompt', example='xxx'),
      rating?: string(name='Rating', example='thumbsUp'),
      responseBodyStr?: string(name='ResponseBodyStr', example='{}'),
      sessionId?: string(name='SessionId', example='xxxx'),
      tags?: [ string ](name='Tags'),
      taskId?: string(name='TaskId', example='xxxx'),
      text?: string(name='Text', example='xxx'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='100'),
}

model ListSearchTaskDialoguesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSearchTaskDialoguesResponseBody(name='body'),
}

/**
 * @summary 查询妙搜搜索生成任务详情列表
 *
 * @param request ListSearchTaskDialoguesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSearchTaskDialoguesResponse
 */
async function listSearchTaskDialoguesWithOptions(request: ListSearchTaskDialoguesRequest, runtime: $RuntimeOptions): ListSearchTaskDialoguesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSearchTaskDialogues',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询妙搜搜索生成任务详情列表
 *
 * @param request ListSearchTaskDialoguesRequest
 * @return ListSearchTaskDialoguesResponse
 */
async function listSearchTaskDialogues(request: ListSearchTaskDialoguesRequest): ListSearchTaskDialoguesResponse {
  var runtime = new $RuntimeOptions{};
  return listSearchTaskDialoguesWithOptions(request, runtime);
}

model ListSearchTasksRequest {
  dialogueTypes?: [ int32 ](name='DialogueTypes', example='24'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xx'),
}

model ListSearchTasksShrinkRequest {
  dialogueTypesShrink?: string(name='DialogueTypes', example='24'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xx'),
}

model ListSearchTasksResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      createTime?: string(name='CreateTime', example='2024-11-25 11:40:50'),
      dialogueType?: int32(name='DialogueType', example='24'),
      taskId?: string(name='TaskId', example='xxxx'),
      taskName?: string(name='TaskName', example='xxx'),
      updateTime?: string(name='UpdateTime', example='2024-11-25 11:40:50'),
      username?: string(name='Username', example='xxxx'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='100'),
}

model ListSearchTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSearchTasksResponseBody(name='body'),
}

/**
 * @summary 查询妙搜搜索生成历史任务列表
 *
 * @param tmpReq ListSearchTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSearchTasksResponse
 */
async function listSearchTasksWithOptions(tmpReq: ListSearchTasksRequest, runtime: $RuntimeOptions): ListSearchTasksResponse {
  tmpReq.validate();
  var request = new ListSearchTasksShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.dialogueTypes)) {
    request.dialogueTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.dialogueTypes, 'DialogueTypes', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.dialogueTypesShrink)) {
    body['DialogueTypes'] = request.dialogueTypesShrink;
  }
  if (!$isNull(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSearchTasks',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询妙搜搜索生成历史任务列表
 *
 * @param request ListSearchTasksRequest
 * @return ListSearchTasksResponse
 */
async function listSearchTasks(request: ListSearchTasksRequest): ListSearchTasksResponse {
  var runtime = new $RuntimeOptions{};
  return listSearchTasksWithOptions(request, runtime);
}

model ListStyleLearningResultRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  current?: int32(name='Current', example='1'),
  size?: int32(name='Size', example='10'),
}

model ListStyleLearningResultResponseBody = {
  code?: string(name='Code', example='NoData'),
  current?: int32(name='Current', example='1'),
  data?: [ 
    {
      aigcResult?: string(name='AigcResult', example='AIGC 生成的内容'),
      id?: long(name='Id', example='70'),
      rewriteResult?: string(name='RewriteResult', example='用户修订后内容'),
      styleName?: string(name='StyleName', example='文体风格名称'),
      taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  size?: int32(name='Size', example='10'),
  success?: boolean(name='Success', example='true'),
  total?: int32(name='Total', example='100'),
}

model ListStyleLearningResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListStyleLearningResultResponseBody(name='body'),
}

/**
 * @summary 获取文体学习分析结果列表
 *
 * @param request ListStyleLearningResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListStyleLearningResultResponse
 */
async function listStyleLearningResultWithOptions(request: ListStyleLearningResultRequest, runtime: $RuntimeOptions): ListStyleLearningResultResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.current)) {
    body['Current'] = request.current;
  }
  if (!$isNull(request.size)) {
    body['Size'] = request.size;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListStyleLearningResult',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取文体学习分析结果列表
 *
 * @param request ListStyleLearningResultRequest
 * @return ListStyleLearningResultResponse
 */
async function listStyleLearningResult(request: ListStyleLearningResultRequest): ListStyleLearningResultResponse {
  var runtime = new $RuntimeOptions{};
  return listStyleLearningResultWithOptions(request, runtime);
}

model ListTimedViewAttitudeRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  maxResults?: int32(name='MaxResults', example='53'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  topic?: string(name='Topic', description='This parameter is required.', example='热榜主题'),
  topicSource?: string(name='TopicSource', description='This parameter is required.', example='热榜源'),
}

model ListTimedViewAttitudeResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      attitude?: string(name='Attitude', example='当前观点'),
      attitudeType?: string(name='AttitudeType', example='观点类型'),
      pubTime?: string(name='PubTime', example='2024-01-22 10:29'),
      ratio?: string(name='Ratio', example='当前观点占比'),
      source?: string(name='Source', example='新浪'),
      title?: string(name='Title', example='标题'),
      url?: string(name='Url', example='http://www.example.com/news/1.html'),
      viewPoints?: [ 
        {
          outlines?: [ 
            {
              outline?: string(name='Outline', example='大纲'),
              summary?: string(name='Summary', example='大纲摘要'),
            }
          ](name='Outlines'),
          point?: string(name='Point', example='视角'),
          summary?: string(name='Summary', example='摘要'),
        }
      ](name='ViewPoints'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='15'),
  message?: string(name='Message', example='success'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='58'),
}

model ListTimedViewAttitudeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTimedViewAttitudeResponseBody(name='body'),
}

/**
 * @summary 时效性视角列表
 *
 * @param request ListTimedViewAttitudeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTimedViewAttitudeResponse
 */
async function listTimedViewAttitudeWithOptions(request: ListTimedViewAttitudeRequest, runtime: $RuntimeOptions): ListTimedViewAttitudeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  if (!$isNull(request.topicSource)) {
    body['TopicSource'] = request.topicSource;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTimedViewAttitude',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 时效性视角列表
 *
 * @param request ListTimedViewAttitudeRequest
 * @return ListTimedViewAttitudeResponse
 */
async function listTimedViewAttitude(request: ListTimedViewAttitudeRequest): ListTimedViewAttitudeResponse {
  var runtime = new $RuntimeOptions{};
  return listTimedViewAttitudeWithOptions(request, runtime);
}

model ListTopicRecommendEventListRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  maxResults?: int32(name='MaxResults', example='72'),
  nextToken?: string(name='NextToken', example='下一页的token'),
}

model ListTopicRecommendEventListResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ string ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='71'),
  message?: string(name='Message', example='success'),
  nextToken?: string(name='NextToken', example='x\\\\"x\\\\"x'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='60'),
}

model ListTopicRecommendEventListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTopicRecommendEventListResponseBody(name='body'),
}

/**
 * @summary 获取热点推荐事件
 *
 * @param request ListTopicRecommendEventListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTopicRecommendEventListResponse
 */
async function listTopicRecommendEventListWithOptions(request: ListTopicRecommendEventListRequest, runtime: $RuntimeOptions): ListTopicRecommendEventListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTopicRecommendEventList',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取热点推荐事件
 *
 * @param request ListTopicRecommendEventListRequest
 * @return ListTopicRecommendEventListResponse
 */
async function listTopicRecommendEventList(request: ListTopicRecommendEventListRequest): ListTopicRecommendEventListResponse {
  var runtime = new $RuntimeOptions{};
  return listTopicRecommendEventListWithOptions(request, runtime);
}

model ListTopicViewPointRecommendEventListRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  id?: string(name='Id', example='xxx'),
  maxResults?: int32(name='MaxResults', example='66'),
  nextToken?: string(name='NextToken', example='下一页的token'),
}

model ListTopicViewPointRecommendEventListResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ string ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='8'),
  message?: string(name='Message', example='success'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='32'),
}

model ListTopicViewPointRecommendEventListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTopicViewPointRecommendEventListResponseBody(name='body'),
}

/**
 * @summary 获取主题事件推荐观点列表
 *
 * @param request ListTopicViewPointRecommendEventListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTopicViewPointRecommendEventListResponse
 */
async function listTopicViewPointRecommendEventListWithOptions(request: ListTopicViewPointRecommendEventListRequest, runtime: $RuntimeOptions): ListTopicViewPointRecommendEventListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTopicViewPointRecommendEventList',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取主题事件推荐观点列表
 *
 * @param request ListTopicViewPointRecommendEventListRequest
 * @return ListTopicViewPointRecommendEventListResponse
 */
async function listTopicViewPointRecommendEventList(request: ListTopicViewPointRecommendEventListRequest): ListTopicViewPointRecommendEventListResponse {
  var runtime = new $RuntimeOptions{};
  return listTopicViewPointRecommendEventListWithOptions(request, runtime);
}

model ListVersionsRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='33a2658aaabf4c24b45d50e575125311_p_beebot_public'),
}

model ListVersionsResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  data?: [ 
    {
      concurrentCount?: int32(name='ConcurrentCount', example='43'),
      endTime?: string(name='EndTime', example='2023-04-23 02:00:34'),
      instanceCount?: int32(name='InstanceCount', example='55'),
      instanceId?: string(name='InstanceId', example='ga-bp12pismsw4v3tzhf62p1'),
      orderId?: long(name='OrderId', example='7'),
      productType?: string(name='ProductType', example='CUSTOMIZE'),
      quota?: int32(name='Quota', example='13'),
      startTime?: string(name='StartTime', example='2023-05-27 04:11:00'),
      useQuota?: int32(name='UseQuota', example='65'),
      versionDetail?: string(name='VersionDetail'),
      versionName?: string(name='VersionName', example='试用版'),
      versionStatus?: int32(name='VersionStatus', example='87'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='数据不存在'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='true'),
}

model ListVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListVersionsResponseBody(name='body'),
}

/**
 * @summary 获取系统所有实例信息
 *
 * @param request ListVersionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListVersionsResponse
 */
async function listVersionsWithOptions(request: ListVersionsRequest, runtime: $RuntimeOptions): ListVersionsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListVersions',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取系统所有实例信息
 *
 * @param request ListVersionsRequest
 * @return ListVersionsResponse
 */
async function listVersions(request: ListVersionsRequest): ListVersionsResponse {
  var runtime = new $RuntimeOptions{};
  return listVersionsWithOptions(request, runtime);
}

model ListWebReviewPointsRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  maxResults?: int32(name='MaxResults', example='81'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  topic?: string(name='Topic', description='This parameter is required.', example='热榜主题'),
  topicSource?: string(name='TopicSource', description='This parameter is required.', example='热榜源'),
}

model ListWebReviewPointsResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: [ 
    {
      attitude?: string(name='Attitude', example='当前观点'),
      attitudeType?: string(name='AttitudeType', example='观点类型'),
      comments?: [ 
        {
          source?: string(name='Source', example='来源'),
          text?: string(name='Text', example='评论内容'),
          title?: string(name='Title', example='标题'),
          url?: string(name='Url', example='当前评论所属的URL'),
          username?: string(name='Username', example='评论用户名'),
        }
      ](name='Comments'),
      ratio?: string(name='Ratio', example='当前观点占比'),
      viewPoints?: [ 
        {
          outlines?: [ 
            {
              outline?: string(name='Outline', example='大纲'),
              summary?: string(name='Summary', example='大纲摘要'),
            }
          ](name='Outlines'),
          point?: string(name='Point', example='视角'),
          summary?: string(name='Summary', example='摘要'),
        }
      ](name='ViewPoints'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  maxResults?: int32(name='MaxResults', example='79'),
  message?: string(name='Message', example='success'),
  nextToken?: string(name='NextToken', example='下一页的token'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
  totalCount?: int32(name='TotalCount', example='32'),
}

model ListWebReviewPointsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWebReviewPointsResponseBody(name='body'),
}

/**
 * @summary 网友视角列表
 *
 * @param request ListWebReviewPointsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWebReviewPointsResponse
 */
async function listWebReviewPointsWithOptions(request: ListWebReviewPointsRequest, runtime: $RuntimeOptions): ListWebReviewPointsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  if (!$isNull(request.topicSource)) {
    body['TopicSource'] = request.topicSource;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListWebReviewPoints',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 网友视角列表
 *
 * @param request ListWebReviewPointsRequest
 * @return ListWebReviewPointsResponse
 */
async function listWebReviewPoints(request: ListWebReviewPointsRequest): ListWebReviewPointsResponse {
  var runtime = new $RuntimeOptions{};
  return listWebReviewPointsWithOptions(request, runtime);
}

model QueryAsyncTaskRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='33a2658aaabf4c24b45d50e575125311_p_beebot_public'),
  taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model QueryAsyncTaskResponseBody = {
  code?: string(name='Code', example='Success'),
  data?: {
    createTime?: string(name='CreateTime', example='2021-07-25 14:34:33'),
    createUser?: string(name='CreateUser', example='12121'),
    taskCode?: string(name='TaskCode', example='MaterialDocumentUpload'),
    taskErrorMessage?: string(name='TaskErrorMessage', example='error'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    taskIntermediateResult?: string(name='TaskIntermediateResult', example='{}'),
    taskName?: string(name='TaskName'),
    taskParam?: string(name='TaskParam', example='{"fileKey":"oss://default/xxxx/xxxx/xxx","fileName":"xxxxx.doc"}'),
    taskProgressMessage?: string(name='TaskProgressMessage', example='{}'),
    taskResult?: string(name='TaskResult', example='{}'),
    taskRetryCount?: string(name='TaskRetryCount', example='3'),
    taskStatus?: int32(name='TaskStatus', example='1'),
    updateTime?: string(name='UpdateTime', example='2023-04-27 18:07:43'),
    updateUser?: string(name='UpdateUser', example='12121'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='867C4ABE-4381-5BC2-9810-5A5F334F71CF'),
  success?: boolean(name='Success', example='True'),
}

model QueryAsyncTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAsyncTaskResponseBody(name='body'),
}

/**
 * @summary 根据taskId查询异步任务状态
 *
 * @param request QueryAsyncTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAsyncTaskResponse
 */
async function queryAsyncTaskWithOptions(request: QueryAsyncTaskRequest, runtime: $RuntimeOptions): QueryAsyncTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'QueryAsyncTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据taskId查询异步任务状态
 *
 * @param request QueryAsyncTaskRequest
 * @return QueryAsyncTaskResponse
 */
async function queryAsyncTask(request: QueryAsyncTaskRequest): QueryAsyncTaskResponse {
  var runtime = new $RuntimeOptions{};
  return queryAsyncTaskWithOptions(request, runtime);
}

model RunAbbreviationContentRequest {
  content?: string(name='Content', description='This parameter is required.', example='创新政务社交媒体功能。鼓励各地区、各部门结合实际，开发政务社交媒体的特色功能，如在线咨询服务、政策解读、互动问答等，增强政务社交媒体的互动性和实用性，提升公众参与度。'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model RunAbbreviationContentResponseBody = {
  end?: boolean(name='End'),
  header?: {
    errorCode?: string(name='ErrorCode', example='403'),
    errorMessage?: string(name='ErrorMessage', example='Pop sign mismatch, please check.'),
    event?: string(name='Event', example='result-generated'),
    eventInfo?: string(name='EventInfo', example='模型生成事件'),
    sessionId?: string(name='SessionId', example='3cd10828-0e42-471c-8f1a-931cde20b035'),
    taskId?: string(name='TaskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='TraceId', example='2150451a17191950923411783e2927'),
  }(name='Header'),
  payload?: {
    output?: {
      text?: string(name='Text', example='这是测试输出'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
}

model RunAbbreviationContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunAbbreviationContentResponseBody(name='body'),
}

/**
 * @summary 内容缩写
 *
 * @param request RunAbbreviationContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunAbbreviationContentResponse
 */
async function runAbbreviationContentWithOptions(request: RunAbbreviationContentRequest, runtime: $RuntimeOptions): RunAbbreviationContentResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.content)) {
    body['Content'] = request.content;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunAbbreviationContent',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 内容缩写
 *
 * @param request RunAbbreviationContentRequest
 * @return RunAbbreviationContentResponse
 */
async function runAbbreviationContent(request: RunAbbreviationContentRequest): RunAbbreviationContentResponse {
  var runtime = new $RuntimeOptions{};
  return runAbbreviationContentWithOptions(request, runtime);
}

model RunBookIntroductionRequest {
  docId?: string(name='DocId', description='This parameter is required.', example='3YQRatoe8phnpIsIE6z7DTPknhG8Fj'),
  keyPointPrompt?: string(name='KeyPointPrompt'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='0f56f98a-f2d8-47ec-98e9-1cbdcffa9539'),
  summaryPrompt?: string(name='SummaryPrompt'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-vtmox6g2bhq2qv5c'),
}

model RunBookIntroductionResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='success'),
    errorMessage?: string(name='ErrorMessage', example='success'),
    event?: string(name='Event', example='finished'),
    eventInfo?: string(name='EventInfo'),
    sessionId?: string(name='SessionId', example='411c4dfa-2168-4379-a902-675d67f453f8'),
    taskId?: string(name='TaskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='TraceId', example='46e5c2b5-0877-4f09-bd91-ab0cf314e48b'),
  }(name='Header'),
  payload?: {
    output?: {
      keyPoint?: string(name='KeyPoint'),
      summary?: string(name='Summary'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', description='Id of the request', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model RunBookIntroductionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunBookIntroductionResponseBody(name='body'),
}

/**
 * @summary 书籍导读接口
 *
 * @param request RunBookIntroductionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunBookIntroductionResponse
 */
async function runBookIntroductionWithOptions(request: RunBookIntroductionRequest, runtime: $RuntimeOptions): RunBookIntroductionResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.keyPointPrompt)) {
    body['KeyPointPrompt'] = request.keyPointPrompt;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.summaryPrompt)) {
    body['SummaryPrompt'] = request.summaryPrompt;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunBookIntroduction',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 书籍导读接口
 *
 * @param request RunBookIntroductionRequest
 * @return RunBookIntroductionResponse
 */
async function runBookIntroduction(request: RunBookIntroductionRequest): RunBookIntroductionResponse {
  var runtime = new $RuntimeOptions{};
  return runBookIntroductionWithOptions(request, runtime);
}

model RunBookSmartCardRequest {
  docId?: string(name='DocId', description='This parameter is required.', example='84ufBYEeLMZOjRFo84HJ7ySL3Efr55'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunBookSmartCardResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='success'),
    errorMessage?: string(name='ErrorMessage', example='success'),
    event?: string(name='Event', example='finished'),
    eventInfo?: string(name='EventInfo'),
    sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    traceId?: string(name='TraceId', example='1a0e898717105546647125853d4f54'),
  }(name='Header'),
  payload?: {
    output?: {
      content?: string(name='Content'),
      tags?: [ string ](name='Tags'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='1'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='101'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', description='Id of the request', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
}

model RunBookSmartCardResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunBookSmartCardResponseBody(name='body'),
}

/**
 * @summary 书籍智能卡片接口
 *
 * @param request RunBookSmartCardRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunBookSmartCardResponse
 */
async function runBookSmartCardWithOptions(request: RunBookSmartCardRequest, runtime: $RuntimeOptions): RunBookSmartCardResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunBookSmartCard',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 书籍智能卡片接口
 *
 * @param request RunBookSmartCardRequest
 * @return RunBookSmartCardResponse
 */
async function runBookSmartCard(request: RunBookSmartCardRequest): RunBookSmartCardResponse {
  var runtime = new $RuntimeOptions{};
  return runBookSmartCardWithOptions(request, runtime);
}

model RunCommentGenerationRequest {
  allowEmoji?: boolean(name='AllowEmoji', example='true'),
  extraInfo?: string(name='ExtraInfo'),
  length?: string(name='Length', example='20'),
  lengthRange?: map[string]any(name='LengthRange', description='This parameter is required.', example='{"short":"50","long":“50”}'),
  numComments?: string(name='NumComments', description='This parameter is required.', example='10'),
  sentiment?: map[string]any(name='Sentiment', description='This parameter is required.', example='{"positive":"50","negative":"50"}'),
  sessionId?: string(name='SessionId'),
  sourceMaterial?: string(name='SourceMaterial', description='This parameter is required.'),
  style?: string(name='Style'),
  type?: map[string]any(name='Type', description='This parameter is required.', example='{"emotion":"50","opinion":"50"}'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-3kcs1w3lltrtbfkr'),
}

model RunCommentGenerationShrinkRequest {
  allowEmoji?: boolean(name='AllowEmoji', example='true'),
  extraInfo?: string(name='ExtraInfo'),
  length?: string(name='Length', example='20'),
  lengthRangeShrink?: string(name='LengthRange', description='This parameter is required.', example='{"short":"50","long":“50”}'),
  numComments?: string(name='NumComments', description='This parameter is required.', example='10'),
  sentimentShrink?: string(name='Sentiment', description='This parameter is required.', example='{"positive":"50","negative":"50"}'),
  sessionId?: string(name='SessionId'),
  sourceMaterial?: string(name='SourceMaterial', description='This parameter is required.'),
  style?: string(name='Style'),
  typeShrink?: string(name='Type', description='This parameter is required.', example='{"emotion":"50","opinion":"50"}'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-3kcs1w3lltrtbfkr'),
}

model RunCommentGenerationResponseBody = {
  end?: boolean(name='End'),
  header?: {
    event?: string(name='Event', example='result-generated'),
    eventInfo?: string(name='EventInfo'),
    requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
    sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    traceId?: string(name='TraceId', example='0bd58ea2-dc38-45da-ac02-17f05cb9040b'),
  }(name='Header'),
  payload?: {
    output?: {
      text?: string(name='Text'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='1'),
      outputTokens?: long(name='OutputTokens', example='2'),
      totalTokens?: long(name='TotalTokens', example='3'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', description='Id of the request', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model RunCommentGenerationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunCommentGenerationResponseBody(name='body'),
}

/**
 * @summary 客户之声预测
 *
 * @param tmpReq RunCommentGenerationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunCommentGenerationResponse
 */
async function runCommentGenerationWithOptions(tmpReq: RunCommentGenerationRequest, runtime: $RuntimeOptions): RunCommentGenerationResponse {
  tmpReq.validate();
  var request = new RunCommentGenerationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.lengthRange)) {
    request.lengthRangeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.lengthRange, 'LengthRange', 'json');
  }
  if (!$isNull(tmpReq.sentiment)) {
    request.sentimentShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sentiment, 'Sentiment', 'json');
  }
  if (!$isNull(tmpReq.type)) {
    request.typeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.type, 'Type', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.allowEmoji)) {
    body['AllowEmoji'] = request.allowEmoji;
  }
  if (!$isNull(request.extraInfo)) {
    body['ExtraInfo'] = request.extraInfo;
  }
  if (!$isNull(request.length)) {
    body['Length'] = request.length;
  }
  if (!$isNull(request.lengthRangeShrink)) {
    body['LengthRange'] = request.lengthRangeShrink;
  }
  if (!$isNull(request.numComments)) {
    body['NumComments'] = request.numComments;
  }
  if (!$isNull(request.sentimentShrink)) {
    body['Sentiment'] = request.sentimentShrink;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.sourceMaterial)) {
    body['SourceMaterial'] = request.sourceMaterial;
  }
  if (!$isNull(request.style)) {
    body['Style'] = request.style;
  }
  if (!$isNull(request.typeShrink)) {
    body['Type'] = request.typeShrink;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunCommentGeneration',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 客户之声预测
 *
 * @param request RunCommentGenerationRequest
 * @return RunCommentGenerationResponse
 */
async function runCommentGeneration(request: RunCommentGenerationRequest): RunCommentGenerationResponse {
  var runtime = new $RuntimeOptions{};
  return runCommentGenerationWithOptions(request, runtime);
}

model RunContinueContentRequest {
  content?: string(name='Content', description='This parameter is required.', example='创新政务社交媒体功能。鼓励各地区、各部门结合实际，开发政务社交媒体的特色功能，如在线咨询服务、政策解读、互动问答等，增强政务社交媒体的互动性和实用性，提升公众参与度。'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model RunContinueContentResponseBody = {
  end?: boolean(name='End'),
  header?: {
    errorCode?: string(name='ErrorCode', example='403'),
    errorMessage?: string(name='ErrorMessage', example='Pop sign mismatch, please check.'),
    event?: string(name='Event', example='result-generated'),
    eventInfo?: string(name='EventInfo', example='模型生成事件'),
    sessionId?: string(name='SessionId', example='3cd10828-0e42-471c-8f1a-931cde20b035'),
    taskId?: string(name='TaskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='TraceId', example='2150451a17191950923411783e2927'),
  }(name='Header'),
  payload?: {
    output?: {
      text?: string(name='Text', example='这是测试输出'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
}

model RunContinueContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunContinueContentResponseBody(name='body'),
}

/**
 * @summary 内容续写
 *
 * @param request RunContinueContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunContinueContentResponse
 */
async function runContinueContentWithOptions(request: RunContinueContentRequest, runtime: $RuntimeOptions): RunContinueContentResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.content)) {
    body['Content'] = request.content;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunContinueContent',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 内容续写
 *
 * @param request RunContinueContentRequest
 * @return RunContinueContentResponse
 */
async function runContinueContent(request: RunContinueContentRequest): RunContinueContentResponse {
  var runtime = new $RuntimeOptions{};
  return runContinueContentWithOptions(request, runtime);
}

model RunCustomHotTopicAnalysisRequest {
  askUser?: string(name='AskUser', example='模型反问'),
  forceAnalysisExistsTopic?: boolean(name='ForceAnalysisExistsTopic', example='false'),
  prompt?: string(name='Prompt', description='This parameter is required.', example='用户输入Prompt'),
  sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  userBack?: string(name='UserBack', example='用户针对模型反问的输入'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model RunCustomHotTopicAnalysisResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='错误码'),
    errorMessage?: string(name='ErrorMessage', example='错误信息'),
    event?: string(name='Event', example='task-started'),
    originSessionId?: string(name='OriginSessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    traceId?: string(name='TraceId', example='全链路ID'),
  }(name='Header'),
  payload?: {
    output?: {
      articles?: [ 
        {
          author?: string(name='Author', example='作者'),
          content?: string(name='Content', example='文章内容'),
          docId?: string(name='DocId', example='文档-自定义的唯一ID'),
          docUuid?: string(name='DocUuid', example='a2103fcfbd5441f1991c72f8834833e3'),
          pubTime?: string(name='PubTime', example='2024-08-27 14:50:47'),
          source?: string(name='Source', example='央视网'),
          summary?: string(name='Summary', example='文章摘要'),
          tag?: string(name='Tag', example='文章标签'),
          title?: string(name='Title', example='文章标题'),
          url?: string(name='Url', example='https://www.example.com/aaa.docx'),
        }
      ](name='Articles'),
      askUser?: [ string ](name='AskUser'),
      asyncTaskId?: string(name='AsyncTaskId', example='异步任务ID'),
      attitude?: string(name='Attitude', example='自定义选题视角'),
      searchQuery?: string(name='SearchQuery', example='大模型改变世界'),
      text?: string(name='Text', example='文本生成结果'),
      topicId?: string(name='TopicId', example='话题ID'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='60'),
      outputTokens?: long(name='OutputTokens', example='13'),
      totalTokens?: long(name='TotalTokens', example='73'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model RunCustomHotTopicAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunCustomHotTopicAnalysisResponseBody(name='body'),
}

/**
 * @summary 自定义热点话题分析
 *
 * @param request RunCustomHotTopicAnalysisRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunCustomHotTopicAnalysisResponse
 */
async function runCustomHotTopicAnalysisWithOptions(request: RunCustomHotTopicAnalysisRequest, runtime: $RuntimeOptions): RunCustomHotTopicAnalysisResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.askUser)) {
    body['AskUser'] = request.askUser;
  }
  if (!$isNull(request.forceAnalysisExistsTopic)) {
    body['ForceAnalysisExistsTopic'] = request.forceAnalysisExistsTopic;
  }
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.userBack)) {
    body['UserBack'] = request.userBack;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunCustomHotTopicAnalysis',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 自定义热点话题分析
 *
 * @param request RunCustomHotTopicAnalysisRequest
 * @return RunCustomHotTopicAnalysisResponse
 */
async function runCustomHotTopicAnalysis(request: RunCustomHotTopicAnalysisRequest): RunCustomHotTopicAnalysisResponse {
  var runtime = new $RuntimeOptions{};
  return runCustomHotTopicAnalysisWithOptions(request, runtime);
}

model RunCustomHotTopicViewPointAnalysisRequest {
  askUser?: string(name='AskUser', example='模型反问'),
  prompt?: string(name='Prompt', description='This parameter is required.', example='自定义选题视角的Prompt'),
  searchQuery?: string(name='SearchQuery', example='改写后的Query'),
  skipAskUser?: boolean(name='SkipAskUser', example='true'),
  topic?: string(name='Topic', example='热点主题'),
  topicId?: string(name='TopicId', example='热点主题ID'),
  topicSource?: string(name='TopicSource', example='热点主题来源'),
  topicVersion?: string(name='TopicVersion', example='热点主题版本'),
  userBack?: string(name='UserBack', example='用户反馈'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model RunCustomHotTopicViewPointAnalysisResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='错误码'),
    errorMessage?: string(name='ErrorMessage', example='错误信息'),
    event?: string(name='Event', example='task-started'),
    originSessionId?: string(name='OriginSessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    traceId?: string(name='TraceId', example='全链路ID'),
  }(name='Header'),
  payload?: {
    output?: {
      askUser?: [ string ](name='AskUser'),
      asyncTaskId?: string(name='AsyncTaskId', example='异步任务ID'),
      attitude?: string(name='Attitude', example='模型生成的自定义选题视角的观点'),
      customViewPointId?: string(name='CustomViewPointId', example='xxxxxx'),
      text?: string(name='Text', example='文本生成结果'),
      topicId?: string(name='TopicId', example='话题ID'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='51'),
      outputTokens?: long(name='OutputTokens', example='79'),
      totalTokens?: long(name='TotalTokens', example='130'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model RunCustomHotTopicViewPointAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunCustomHotTopicViewPointAnalysisResponseBody(name='body'),
}

/**
 * @summary 自定义选题视角分析
 *
 * @param request RunCustomHotTopicViewPointAnalysisRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunCustomHotTopicViewPointAnalysisResponse
 */
async function runCustomHotTopicViewPointAnalysisWithOptions(request: RunCustomHotTopicViewPointAnalysisRequest, runtime: $RuntimeOptions): RunCustomHotTopicViewPointAnalysisResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.askUser)) {
    body['AskUser'] = request.askUser;
  }
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.searchQuery)) {
    body['SearchQuery'] = request.searchQuery;
  }
  if (!$isNull(request.skipAskUser)) {
    body['SkipAskUser'] = request.skipAskUser;
  }
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  if (!$isNull(request.topicId)) {
    body['TopicId'] = request.topicId;
  }
  if (!$isNull(request.topicSource)) {
    body['TopicSource'] = request.topicSource;
  }
  if (!$isNull(request.topicVersion)) {
    body['TopicVersion'] = request.topicVersion;
  }
  if (!$isNull(request.userBack)) {
    body['UserBack'] = request.userBack;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunCustomHotTopicViewPointAnalysis',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 自定义选题视角分析
 *
 * @param request RunCustomHotTopicViewPointAnalysisRequest
 * @return RunCustomHotTopicViewPointAnalysisResponse
 */
async function runCustomHotTopicViewPointAnalysis(request: RunCustomHotTopicViewPointAnalysisRequest): RunCustomHotTopicViewPointAnalysisResponse {
  var runtime = new $RuntimeOptions{};
  return runCustomHotTopicViewPointAnalysisWithOptions(request, runtime);
}

model RunDocBrainmapRequest {
  cleanCache?: boolean(name='CleanCache'),
  docId?: string(name='DocId', description='This parameter is required.', example='12345'),
  nodeNumber?: int32(name='NodeNumber'),
  prompt?: string(name='Prompt'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  wordNumber?: int32(name='WordNumber'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
  referenceContent?: string(name='referenceContent'),
}

model RunDocBrainmapResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='success'),
    errorMessage?: string(name='ErrorMessage', example='success'),
    event?: string(name='Event', example='task-failed'),
    eventInfo?: string(name='EventInfo'),
    sessionId?: string(name='SessionId', example='07181f55-2311-48af-8048-132a77dee020'),
    taskId?: string(name='TaskId', example='161816'),
    traceId?: string(name='TraceId', example='6427cdf4-2ffe-4d05-b0ef-c4adceea90f4'),
  }(name='Header'),
  payload?: {
    output?: {
      content?: string(name='Content', example='{"xxxx":"xxx"}'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='65'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='165'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
}

model RunDocBrainmapResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunDocBrainmapResponseBody(name='body'),
}

/**
 * @summary 妙读脑图生成接口
 *
 * @param request RunDocBrainmapRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunDocBrainmapResponse
 */
async function runDocBrainmapWithOptions(request: RunDocBrainmapRequest, runtime: $RuntimeOptions): RunDocBrainmapResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.cleanCache)) {
    body['CleanCache'] = request.cleanCache;
  }
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.nodeNumber)) {
    body['NodeNumber'] = request.nodeNumber;
  }
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.wordNumber)) {
    body['WordNumber'] = request.wordNumber;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  if (!$isNull(request.referenceContent)) {
    body['referenceContent'] = request.referenceContent;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunDocBrainmap',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读脑图生成接口
 *
 * @param request RunDocBrainmapRequest
 * @return RunDocBrainmapResponse
 */
async function runDocBrainmap(request: RunDocBrainmapRequest): RunDocBrainmapResponse {
  var runtime = new $RuntimeOptions{};
  return runDocBrainmapWithOptions(request, runtime);
}

model RunDocIntroductionRequest {
  cleanCache?: boolean(name='CleanCache'),
  docId?: string(name='DocId', description='This parameter is required.', example='12345'),
  introductionPrompt?: string(name='IntroductionPrompt'),
  keyPointPrompt?: string(name='KeyPointPrompt'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='a3b5eb35-6b28-4cf9-ac09-1dec25ab4df6'),
  summaryPrompt?: string(name='SummaryPrompt'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
  referenceContent?: string(name='referenceContent'),
}

model RunDocIntroductionResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='success'),
    errorMessage?: string(name='ErrorMessage', example='success'),
    event?: string(name='Event', example='task-started'),
    eventInfo?: string(name='EventInfo'),
    sessionId?: string(name='SessionId', example='20247a52-23e2-46fb-943d-309cdee2bc6d'),
    taskId?: string(name='TaskId', example='8a9cecb7-6d20-32db-8823-5882c217b647'),
    traceId?: string(name='TraceId', example='0bd58ea2-dc38-45da-ac02-17f05cb9040b'),
  }(name='Header'),
  payload?: {
    output?: {
      introductions?: [ 
        {
          blocks?: [ 
            {
              beginTime?: long(name='BeginTime', example='0'),
              endTime?: long(name='EndTime', example='1200'),
              height?: int32(name='Height', example='600'),
              pageId?: int32(name='PageId', example='10'),
              width?: int32(name='Width', example='600'),
              x?: int32(name='X', example='10'),
              y?: int32(name='Y', example='10'),
            }
          ](name='Blocks'),
          startPageId?: int32(name='StartPageId', example='10'),
          summary?: string(name='Summary'),
          title?: string(name='Title'),
        }
      ](name='Introductions'),
      keyPoint?: string(name='KeyPoint'),
      summary?: string(name='Summary'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='C9B5BEA6-E8C4-5861-BE37-D906D516510E'),
}

model RunDocIntroductionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunDocIntroductionResponseBody(name='body'),
}

/**
 * @summary 妙读文档导读接口
 *
 * @param request RunDocIntroductionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunDocIntroductionResponse
 */
async function runDocIntroductionWithOptions(request: RunDocIntroductionRequest, runtime: $RuntimeOptions): RunDocIntroductionResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.cleanCache)) {
    body['CleanCache'] = request.cleanCache;
  }
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.introductionPrompt)) {
    body['IntroductionPrompt'] = request.introductionPrompt;
  }
  if (!$isNull(request.keyPointPrompt)) {
    body['KeyPointPrompt'] = request.keyPointPrompt;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.summaryPrompt)) {
    body['SummaryPrompt'] = request.summaryPrompt;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  if (!$isNull(request.referenceContent)) {
    body['referenceContent'] = request.referenceContent;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunDocIntroduction',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读文档导读接口
 *
 * @param request RunDocIntroductionRequest
 * @return RunDocIntroductionResponse
 */
async function runDocIntroduction(request: RunDocIntroductionRequest): RunDocIntroductionResponse {
  var runtime = new $RuntimeOptions{};
  return runDocIntroductionWithOptions(request, runtime);
}

model RunDocQaRequest {
  categoryIds?: [ string ](name='CategoryIds'),
  conversationContexts?: [ 
    {
      content?: string(name='Content'),
      role?: string(name='Role', example='user'),
    }
  ](name='ConversationContexts'),
  docIds?: [ string ](name='DocIds'),
  query?: string(name='Query', description='This parameter is required.'),
  referenceContent?: string(name='ReferenceContent'),
  searchSource?: string(name='SearchSource', description='This parameter is required.', example='fromWeb'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='f486c4e2-b773-4d65-88f8-2ba540610456'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-dswd4003ny4gh9rw'),
}

model RunDocQaShrinkRequest {
  categoryIdsShrink?: string(name='CategoryIds'),
  conversationContextsShrink?: string(name='ConversationContexts'),
  docIdsShrink?: string(name='DocIds'),
  query?: string(name='Query', description='This parameter is required.'),
  referenceContent?: string(name='ReferenceContent'),
  searchSource?: string(name='SearchSource', description='This parameter is required.', example='fromWeb'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='f486c4e2-b773-4d65-88f8-2ba540610456'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-dswd4003ny4gh9rw'),
}

model RunDocQaResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='success'),
    errorMessage?: string(name='ErrorMessage', example='success'),
    event?: string(name='Event', example='task-started'),
    eventInfo?: string(name='EventInfo'),
    sessionId?: string(name='SessionId', example='f5517ee8-dbec-4dc8-bd0a-af084b5e3db1'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    traceId?: string(name='TraceId', example='46e5c2b5-0877-4f09-bd91-ab0cf314e48b'),
  }(name='Header'),
  payload?: {
    output?: {
      content?: string(name='Content'),
      interveneContent?: string(name='InterveneContent'),
      isReject?: boolean(name='IsReject', example='false'),
      mediaUrlList?: [ 
        {
          clipInfos?: [ 
            {
              from?: double(name='From', example='0'),
              to?: double(name='To', example='30'),
            }
          ](name='ClipInfos'),
          fileUrl?: string(name='FileUrl', example='https://gw.alicdn.com/imgextra/i3/2775676850/O1CN01kdeffE20TM0E7wvpq_!!2775676850.jpg_q60.jpg'),
          mediaType?: string(name='MediaType', example='video'),
        }
      ](name='MediaUrlList'),
      recommends?: [ 
        {
          title?: string(name='Title'),
          url?: string(name='Url'),
        }
      ](name='Recommends'),
      references?: [ 
        {
          pubTime?: string(name='PubTime', example='2024-10-08 18:00'),
          source?: string(name='Source'),
          sourceDocId?: string(name='SourceDocId', example='123456'),
          title?: string(name='Title'),
          url?: string(name='Url', example='http://xxxxx'),
        }
      ](name='References'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
}

model RunDocQaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunDocQaResponseBody(name='body'),
}

/**
 * @summary 妙读问答接口
 *
 * @param tmpReq RunDocQaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunDocQaResponse
 */
async function runDocQaWithOptions(tmpReq: RunDocQaRequest, runtime: $RuntimeOptions): RunDocQaResponse {
  tmpReq.validate();
  var request = new RunDocQaShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.categoryIds)) {
    request.categoryIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.categoryIds, 'CategoryIds', 'json');
  }
  if (!$isNull(tmpReq.conversationContexts)) {
    request.conversationContextsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.conversationContexts, 'ConversationContexts', 'json');
  }
  if (!$isNull(tmpReq.docIds)) {
    request.docIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.docIds, 'DocIds', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.categoryIdsShrink)) {
    body['CategoryIds'] = request.categoryIdsShrink;
  }
  if (!$isNull(request.conversationContextsShrink)) {
    body['ConversationContexts'] = request.conversationContextsShrink;
  }
  if (!$isNull(request.docIdsShrink)) {
    body['DocIds'] = request.docIdsShrink;
  }
  if (!$isNull(request.query)) {
    body['Query'] = request.query;
  }
  if (!$isNull(request.referenceContent)) {
    body['ReferenceContent'] = request.referenceContent;
  }
  if (!$isNull(request.searchSource)) {
    body['SearchSource'] = request.searchSource;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunDocQa',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读问答接口
 *
 * @param request RunDocQaRequest
 * @return RunDocQaResponse
 */
async function runDocQa(request: RunDocQaRequest): RunDocQaResponse {
  var runtime = new $RuntimeOptions{};
  return runDocQaWithOptions(request, runtime);
}

model RunDocSmartCardRequest {
  docId?: string(name='DocId', description='This parameter is required.', example='84ufBYEeLMZOjRFo84HJ7ySL3Efr55'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model RunDocSmartCardResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='success'),
    errorMessage?: string(name='ErrorMessage', example='success'),
    event?: string(name='Event', example='finished'),
    eventInfo?: string(name='EventInfo'),
    sessionId?: string(name='SessionId', example='07181f55-2311-48af-8048-132a77dee020'),
    taskId?: string(name='TaskId', example='8d55b429d7c6d321fcff54823e8d317b'),
    traceId?: string(name='TraceId', example='0abb781c17337107444473701ed7c3'),
  }(name='Header'),
  payload?: {
    output?: {
      content?: string(name='Content'),
      tags?: [ string ](name='Tags'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='1'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='101'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', description='Id of the request', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
}

model RunDocSmartCardResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunDocSmartCardResponseBody(name='body'),
}

/**
 * @summary 文档智能卡片接口
 *
 * @param request RunDocSmartCardRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunDocSmartCardResponse
 */
async function runDocSmartCardWithOptions(request: RunDocSmartCardRequest, runtime: $RuntimeOptions): RunDocSmartCardResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunDocSmartCard',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档智能卡片接口
 *
 * @param request RunDocSmartCardRequest
 * @return RunDocSmartCardResponse
 */
async function runDocSmartCard(request: RunDocSmartCardRequest): RunDocSmartCardResponse {
  var runtime = new $RuntimeOptions{};
  return runDocSmartCardWithOptions(request, runtime);
}

model RunDocSummaryRequest {
  cleanCache?: boolean(name='CleanCache'),
  docId?: string(name='DocId', example='12345'),
  query?: string(name='Query'),
  recommendContent?: string(name='RecommendContent'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='0f56f98a-f2d8-47ec-98e9-1cbdcffa9539'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model RunDocSummaryResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='success'),
    errorMessage?: string(name='ErrorMessage', example='success'),
    event?: string(name='Event', example='task-started'),
    eventInfo?: string(name='EventInfo'),
    sessionId?: string(name='SessionId', example='92e16ccb-92b6-4894-abbf-fc6e2929a0df'),
    taskId?: string(name='TaskId', example='b057f2fa-2277-477b-babf-cbc062307828'),
    traceId?: string(name='TraceId', example='2150451a17191950923411783e2927'),
  }(name='Header'),
  payload?: {
    output?: {
      content?: string(name='Content'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='3259D344-E871-5DE0-8FFE-CDA21F8D4382'),
}

model RunDocSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunDocSummaryResponseBody(name='body'),
}

/**
 * @summary 妙读文档总结摘要接口
 *
 * @param request RunDocSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunDocSummaryResponse
 */
async function runDocSummaryWithOptions(request: RunDocSummaryRequest, runtime: $RuntimeOptions): RunDocSummaryResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.cleanCache)) {
    body['CleanCache'] = request.cleanCache;
  }
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.query)) {
    body['Query'] = request.query;
  }
  if (!$isNull(request.recommendContent)) {
    body['RecommendContent'] = request.recommendContent;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunDocSummary',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读文档总结摘要接口
 *
 * @param request RunDocSummaryRequest
 * @return RunDocSummaryResponse
 */
async function runDocSummary(request: RunDocSummaryRequest): RunDocSummaryResponse {
  var runtime = new $RuntimeOptions{};
  return runDocSummaryWithOptions(request, runtime);
}

model RunDocTranslationRequest {
  cleanCache?: boolean(name='CleanCache'),
  docId?: string(name='DocId', example='12345'),
  recommendContent?: string(name='RecommendContent'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='2e6b3987-f743-4d4c-8326-d9c41a6af3ee'),
  transType?: string(name='TransType', example='toChinese
toEnglish'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunDocTranslationResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='success'),
    errorMessage?: string(name='ErrorMessage', example='success'),
    event?: string(name='Event', example='task-started'),
    eventInfo?: string(name='EventInfo'),
    sessionId?: string(name='SessionId', example='411c4dfa-2168-4379-a902-675d67f453f8'),
    taskId?: string(name='TaskId', example='50a1cc8e-717e-4a2b-a76b-dc9734a8564b'),
    traceId?: string(name='TraceId', example='ebd19b12-0cae-488f-9e41-5a1c825f545b'),
  }(name='Header'),
  payload?: {
    output?: {
      content?: string(name='Content'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
}

model RunDocTranslationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunDocTranslationResponseBody(name='body'),
}

/**
 * @summary 妙读文档翻译接口
 *
 * @param request RunDocTranslationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunDocTranslationResponse
 */
async function runDocTranslationWithOptions(request: RunDocTranslationRequest, runtime: $RuntimeOptions): RunDocTranslationResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.cleanCache)) {
    body['CleanCache'] = request.cleanCache;
  }
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.recommendContent)) {
    body['RecommendContent'] = request.recommendContent;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.transType)) {
    body['TransType'] = request.transType;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunDocTranslation',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读文档翻译接口
 *
 * @param request RunDocTranslationRequest
 * @return RunDocTranslationResponse
 */
async function runDocTranslation(request: RunDocTranslationRequest): RunDocTranslationResponse {
  var runtime = new $RuntimeOptions{};
  return runDocTranslationWithOptions(request, runtime);
}

model RunDocWashingRequest {
  prompt?: string(name='Prompt'),
  referenceContent?: string(name='ReferenceContent', description='This parameter is required.'),
  sessionId?: string(name='SessionId'),
  topic?: string(name='Topic'),
  wordNumber?: int32(name='WordNumber', example='500'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
  writingTypeName?: string(name='WritingTypeName'),
  writingTypeRefDoc?: string(name='WritingTypeRefDoc'),
}

model RunDocWashingResponseBody = {
  end?: boolean(name='End', example='false'),
  header?: {
    event?: string(name='Event', example='task-finished'),
    eventInfo?: string(name='EventInfo'),
    requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    sessionId?: string(name='SessionId', example='20247a52-23e2-46fb-943d-309cdee2bc6d'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    traceId?: string(name='TraceId', example='2150451a17191950923411783e2927'),
  }(name='Header'),
  payload?: {
    output?: {
      text?: string(name='Text'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', description='Id of the request', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
}

model RunDocWashingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunDocWashingResponseBody(name='body'),
}

/**
 * @summary 文档改写
 *
 * @param request RunDocWashingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunDocWashingResponse
 */
async function runDocWashingWithOptions(request: RunDocWashingRequest, runtime: $RuntimeOptions): RunDocWashingResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.referenceContent)) {
    body['ReferenceContent'] = request.referenceContent;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  if (!$isNull(request.wordNumber)) {
    body['WordNumber'] = request.wordNumber;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  if (!$isNull(request.writingTypeName)) {
    body['WritingTypeName'] = request.writingTypeName;
  }
  if (!$isNull(request.writingTypeRefDoc)) {
    body['WritingTypeRefDoc'] = request.writingTypeRefDoc;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunDocWashing',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档改写
 *
 * @param request RunDocWashingRequest
 * @return RunDocWashingResponse
 */
async function runDocWashing(request: RunDocWashingRequest): RunDocWashingResponse {
  var runtime = new $RuntimeOptions{};
  return runDocWashingWithOptions(request, runtime);
}

model RunExpandContentRequest {
  content?: string(name='Content', description='This parameter is required.', example='创新政务社交媒体功能。鼓励各地区、各部门结合实际，开发政务社交媒体的特色功能，如在线咨询服务、政策解读、互动问答等，增强政务社交媒体的互动性和实用性，提升公众参与度。'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model RunExpandContentResponseBody = {
  end?: boolean(name='End'),
  header?: {
    errorCode?: string(name='ErrorCode', example='403'),
    errorMessage?: string(name='ErrorMessage', example='Pop sign mismatch, please check.'),
    event?: string(name='Event', example='result-generated'),
    eventInfo?: string(name='EventInfo', example='模型生成事件'),
    sessionId?: string(name='SessionId', example='3cd10828-0e42-471c-8f1a-931cde20b035'),
    taskId?: string(name='TaskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='TraceId', example='2150451a17191950923411783e2927'),
  }(name='Header'),
  payload?: {
    output?: {
      text?: string(name='Text', example='这是测试输出'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
}

model RunExpandContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunExpandContentResponseBody(name='body'),
}

/**
 * @summary 内容扩写
 *
 * @param request RunExpandContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunExpandContentResponse
 */
async function runExpandContentWithOptions(request: RunExpandContentRequest, runtime: $RuntimeOptions): RunExpandContentResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.content)) {
    body['Content'] = request.content;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunExpandContent',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 内容扩写
 *
 * @param request RunExpandContentRequest
 * @return RunExpandContentResponse
 */
async function runExpandContent(request: RunExpandContentRequest): RunExpandContentResponse {
  var runtime = new $RuntimeOptions{};
  return runExpandContentWithOptions(request, runtime);
}

model RunGenerateQuestionsRequest {
  docId?: string(name='DocId', example='oOgIwodFANW1u5MnqxysOh1rtld3xn'),
  referenceContent?: string(name='ReferenceContent'),
  sessionId?: string(name='SessionId', example='f486c4e2-b773-4d65-88f8-2ba540610456'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-w335gauzlbba2vze'),
}

model RunGenerateQuestionsResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='200'),
    errorMessage?: string(name='ErrorMessage', example='success'),
    event?: string(name='Event', example='finished'),
    eventInfo?: string(name='EventInfo'),
    sessionId?: string(name='SessionId', example='3cd10828-0e42-471c-8f1a-931cde20b035'),
    taskId?: string(name='TaskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='TraceId', example='0bc3b4b417362160345997589e5f6e'),
  }(name='Header'),
  payload?: {
    output?: {
      content?: string(name='Content'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', description='Id of the request', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
}

model RunGenerateQuestionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunGenerateQuestionsResponseBody(name='body'),
}

/**
 * @summary 妙读猜你想问接口
 *
 * @param request RunGenerateQuestionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunGenerateQuestionsResponse
 */
async function runGenerateQuestionsWithOptions(request: RunGenerateQuestionsRequest, runtime: $RuntimeOptions): RunGenerateQuestionsResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.referenceContent)) {
    body['ReferenceContent'] = request.referenceContent;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunGenerateQuestions',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读猜你想问接口
 *
 * @param request RunGenerateQuestionsRequest
 * @return RunGenerateQuestionsResponse
 */
async function runGenerateQuestions(request: RunGenerateQuestionsRequest): RunGenerateQuestionsResponse {
  var runtime = new $RuntimeOptions{};
  return runGenerateQuestionsWithOptions(request, runtime);
}

model RunHotwordRequest {
  docId?: string(name='DocId', example='84ufBYEeLMZOjRFo84HJ7ySL3Efr55'),
  prompt?: string(name='Prompt'),
  referenceContent?: string(name='ReferenceContent'),
  sessionId?: string(name='SessionId', example='e32a1a3f-1f7e-41dd-b888-ef1d91b96d1e'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-baw8as25ll3wnzjr'),
}

model RunHotwordResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='200'),
    errorMessage?: string(name='ErrorMessage', example='success'),
    event?: string(name='Event', example='finished'),
    eventInfo?: string(name='EventInfo'),
    sessionId?: string(name='SessionId', example='92e16ccb-92b6-4894-abbf-fc6e2929a0df'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    traceId?: string(name='TraceId', example='0abb7e3217356108993888059ee72b'),
  }(name='Header'),
  payload?: {
    output?: {
      content?: string(name='Content'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='1'),
      totalTokens?: long(name='TotalTokens', example='101'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', description='Id of the request', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
}

model RunHotwordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunHotwordResponseBody(name='body'),
}

/**
 * @summary 妙读文档关键词抽取接口
 *
 * @param request RunHotwordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunHotwordResponse
 */
async function runHotwordWithOptions(request: RunHotwordRequest, runtime: $RuntimeOptions): RunHotwordResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.docId)) {
    body['DocId'] = request.docId;
  }
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.referenceContent)) {
    body['ReferenceContent'] = request.referenceContent;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunHotword',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读文档关键词抽取接口
 *
 * @param request RunHotwordRequest
 * @return RunHotwordResponse
 */
async function runHotword(request: RunHotwordRequest): RunHotwordResponse {
  var runtime = new $RuntimeOptions{};
  return runHotwordWithOptions(request, runtime);
}

model RunKeywordsExtractionGenerationRequest {
  referenceData?: {
    contents?: [ string ](name='Contents', description='This parameter is required.'),
  }(name='ReferenceData', description='This parameter is required.'),
  taskId?: string(name='TaskId', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunKeywordsExtractionGenerationShrinkRequest {
  referenceDataShrink?: string(name='ReferenceData', description='This parameter is required.'),
  taskId?: string(name='TaskId', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunKeywordsExtractionGenerationResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='AccessForbid'),
    errorMessage?: string(name='ErrorMessage', example='xx'),
    event?: string(name='Event', example='task-failed'),
    sessionId?: string(name='SessionId', example='1a3d7c9f-3a6d-4e49-b176-2d8721a27397'),
    taskId?: string(name='TaskId', example='8d55b429d7c6d321fcff54823e8d317b'),
    traceId?: string(name='TraceId', example='210bc4e817219607963985396de8bd'),
  }(name='Header'),
  payload?: {
    output?: {
      text?: string(name='Text', example='xxx'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='1'),
      outputTokens?: long(name='OutputTokens', example='1'),
      totalTokens?: long(name='TotalTokens', example='2'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='419F3FBE-5C8D-5949-AC29-E9615235D15A'),
}

model RunKeywordsExtractionGenerationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunKeywordsExtractionGenerationResponseBody(name='body'),
}

/**
 * @summary AI妙笔-创作-抽取关键词
 *
 * @param tmpReq RunKeywordsExtractionGenerationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunKeywordsExtractionGenerationResponse
 */
async function runKeywordsExtractionGenerationWithOptions(tmpReq: RunKeywordsExtractionGenerationRequest, runtime: $RuntimeOptions): RunKeywordsExtractionGenerationResponse {
  tmpReq.validate();
  var request = new RunKeywordsExtractionGenerationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.referenceData)) {
    request.referenceDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.referenceData, 'ReferenceData', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.referenceDataShrink)) {
    body['ReferenceData'] = request.referenceDataShrink;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunKeywordsExtractionGeneration',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary AI妙笔-创作-抽取关键词
 *
 * @param request RunKeywordsExtractionGenerationRequest
 * @return RunKeywordsExtractionGenerationResponse
 */
async function runKeywordsExtractionGeneration(request: RunKeywordsExtractionGenerationRequest): RunKeywordsExtractionGenerationResponse {
  var runtime = new $RuntimeOptions{};
  return runKeywordsExtractionGenerationWithOptions(request, runtime);
}

model RunMultiDocIntroductionRequest {
  docIds?: [ string ](name='DocIds', description='This parameter is required.'),
  keyPointPrompt?: string(name='KeyPointPrompt'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='75bf82fa-b71b-45d7-ae40-0b00e496cd9e'),
  summaryPrompt?: string(name='SummaryPrompt'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model RunMultiDocIntroductionShrinkRequest {
  docIdsShrink?: string(name='DocIds', description='This parameter is required.'),
  keyPointPrompt?: string(name='KeyPointPrompt'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='75bf82fa-b71b-45d7-ae40-0b00e496cd9e'),
  summaryPrompt?: string(name='SummaryPrompt'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model RunMultiDocIntroductionResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='200'),
    errorMessage?: string(name='ErrorMessage', example='Message does not exist.'),
    event?: string(name='Event', example='finished'),
    eventInfo?: string(name='EventInfo'),
    sessionId?: string(name='SessionId', example='92e16ccb-92b6-4894-abbf-fc6e2929a0df'),
    taskId?: string(name='TaskId', example='b057f2fa-2277-477b-babf-cbc062307828'),
    traceId?: string(name='TraceId', example='46e5c2b5-0877-4f09-bd91-ab0cf314e48b'),
  }(name='Header'),
  payload?: {
    output?: {
      keyPoints?: [ 
        {
          keyPoint?: string(name='KeyPoint'),
          source?: string(name='Source'),
        }
      ](name='KeyPoints'),
      summary?: string(name='Summary'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='65'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='165'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', description='Id of the request', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model RunMultiDocIntroductionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunMultiDocIntroductionResponseBody(name='body'),
}

/**
 * @summary 文档批量导读
 *
 * @param tmpReq RunMultiDocIntroductionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunMultiDocIntroductionResponse
 */
async function runMultiDocIntroductionWithOptions(tmpReq: RunMultiDocIntroductionRequest, runtime: $RuntimeOptions): RunMultiDocIntroductionResponse {
  tmpReq.validate();
  var request = new RunMultiDocIntroductionShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.docIds)) {
    request.docIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.docIds, 'DocIds', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.docIdsShrink)) {
    body['DocIds'] = request.docIdsShrink;
  }
  if (!$isNull(request.keyPointPrompt)) {
    body['KeyPointPrompt'] = request.keyPointPrompt;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.summaryPrompt)) {
    body['SummaryPrompt'] = request.summaryPrompt;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunMultiDocIntroduction',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档批量导读
 *
 * @param request RunMultiDocIntroductionRequest
 * @return RunMultiDocIntroductionResponse
 */
async function runMultiDocIntroduction(request: RunMultiDocIntroductionRequest): RunMultiDocIntroductionResponse {
  var runtime = new $RuntimeOptions{};
  return runMultiDocIntroductionWithOptions(request, runtime);
}

model RunSearchGenerationRequest {
  agentContext?: {
    bizContext?: {
      askUser?: string(name='AskUser'),
      askUserKeywords?: [ string ](name='AskUserKeywords'),
      currentStep?: string(name='CurrentStep'),
      multimodalMediaSelection?: {
        originalSessionId?: string(name='OriginalSessionId', example='原始会话唯一标识：搜索结果取这个会话中的全量，目前仅媒资搜索场景需要'),
        searchModel?: string(name='SearchModel', example='TextGenerate'),
        searchModelDataValue?: string(name='SearchModelDataValue', example='分类1'),
        selectionType?: string(name='SelectionType', example='all'),
        sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
        textSearchResult?: {
          searchResult?: [ 
            {
              chunks?: [ string ](name='Chunks'),
              content?: string(name='Content', example='文章内容'),
              docId?: string(name='DocId', example='文档-自定义的唯一ID'),
              docUuid?: string(name='DocUuid', example='xxx'),
              pubTime?: string(name='PubTime', example='2024-11-25 14:25:59'),
              score?: float(name='Score', example='1'),
              searchSource?: string(name='SearchSource', example='QuarkCommonNews'),
              searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
              searchSourceType?: string(name='SearchSourceType', example='SystemSearch'),
              source?: string(name='Source', example='新华社'),
              summary?: string(name='Summary', example='文章摘要'),
              title?: string(name='Title', example='文章标题'),
              url?: string(name='Url', example='https://www.example.com/aaa.docx'),
            }
          ](name='SearchResult'),
        }(name='TextSearchResult'),
      }(name='MultimodalMediaSelection'),
      nextStep?: string(name='NextStep'),
      skipCurrentSupplement?: boolean(name='SkipCurrentSupplement'),
      supplementDataType?: string(name='SupplementDataType'),
      supplementEnable?: boolean(name='SupplementEnable'),
      userBack?: string(name='UserBack'),
      userBackKeywords?: [ string ](name='UserBackKeywords'),
    }(name='BizContext'),
  }(name='AgentContext'),
  chatConfig?: {
    generateLevel?: string(name='GenerateLevel', example='concise'),
    generateTechnology?: string(name='GenerateTechnology', example='copilotPrecise'),
    searchModels?: [ string ](name='SearchModels'),
    searchParam?: {
      endTime?: long(name='EndTime', example='1725983999999'),
      multimodalSearchTypes?: [ string ](name='MultimodalSearchTypes'),
      searchSources?: [ 
        {
          code?: string(name='Code', example='SystemSearch'),
          datasetName?: string(name='DatasetName', example='QuarkCommonNews'),
        }
      ](name='SearchSources'),
      startTime?: long(name='StartTime', example='1725983999999'),
    }(name='SearchParam'),
  }(name='ChatConfig', example='xxx'),
  modelId?: string(name='ModelId', example='qwen-max-latest'),
  originalSessionId?: string(name='OriginalSessionId', example='xxx'),
  prompt?: string(name='Prompt', example='xxx'),
  taskId?: string(name='TaskId', example='7AA2AE16-D873-5C5F-9708-15396C382EB1'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunSearchGenerationShrinkRequest {
  agentContextShrink?: string(name='AgentContext'),
  chatConfigShrink?: string(name='ChatConfig', example='xxx'),
  modelId?: string(name='ModelId', example='qwen-max-latest'),
  originalSessionId?: string(name='OriginalSessionId', example='xxx'),
  prompt?: string(name='Prompt', example='xxx'),
  taskId?: string(name='TaskId', example='7AA2AE16-D873-5C5F-9708-15396C382EB1'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunSearchGenerationResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='AccessForbid'),
    errorMessage?: string(name='ErrorMessage', example='xx'),
    event?: string(name='Event', example='task-failed'),
    eventInfo?: string(name='EventInfo', example='xx'),
    originSessionId?: string(name='OriginSessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    responseTime?: long(name='ResponseTime', example='1'),
    sessionId?: string(name='SessionId', example='x'),
    taskId?: string(name='TaskId', example='x'),
    traceId?: string(name='TraceId', example='xx'),
  }(name='Header'),
  payload?: {
    output?: {
      agentContext?: {
        bizContext?: {
          askUser?: string(name='AskUser', example='您想了解关于xx的哪些信息？'),
          askUserKeywords?: [ string ](name='AskUserKeywords'),
          currentStep?: string(name='CurrentStep', example='start'),
          generatedContent?: {
            clusterTopicResult?: {
              clusterTopics?: [ 
                {
                  imageSearchResult?: {
                    current?: int32(name='Current', example='1'),
                    searchResult?: [ 
                      {
                        article?: {
                          docId?: string(name='DocId', example='xx'),
                          docUuid?: string(name='DocUuid', example='xx'),
                          searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
                          summary?: string(name='Summary', example='xx'),
                          title?: string(name='Title', example='xx'),
                          url?: string(name='Url', example='xx'),
                        }(name='Article'),
                        fileUrl?: string(name='FileUrl', example='xx'),
                        mediaId?: string(name='MediaId', example='xx'),
                      }
                    ](name='SearchResult'),
                    size?: int32(name='Size', example='1'),
                    total?: int32(name='Total', example='1'),
                  }(name='ImageSearchResult'),
                  textSearchResult?: {
                    current?: int32(name='Current', example='1'),
                    searchResult?: [ 
                      {
                        docId?: string(name='DocId', example='xx'),
                        docUuid?: string(name='DocUuid', example='xx'),
                        multimodalMedias?: [ 
                          {
                            fileUrl?: string(name='FileUrl', example='xx'),
                            mediaId?: string(name='MediaId', example='xx'),
                            mediaType?: string(name='MediaType', example='image'),
                          }
                        ](name='MultimodalMedias'),
                        pubTime?: string(name='PubTime', example='2023-04-04 08:39:09'),
                        searchSource?: string(name='SearchSource', example='QuarkCommonNews'),
                        searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
                        searchSourceType?: string(name='SearchSourceType', example='SystemSearch'),
                        summary?: string(name='Summary', example='xx'),
                        title?: string(name='Title', example='xx'),
                        url?: string(name='Url', example='xx'),
                      }
                    ](name='SearchResult'),
                    size?: int32(name='Size', example='1'),
                    total?: int32(name='Total', example='1'),
                  }(name='TextSearchResult'),
                  topic?: string(name='Topic', example='xx'),
                  videoSearchResult?: {
                    current?: int32(name='Current', example='1'),
                    searchResult?: [ 
                      {
                        article?: {
                          docId?: string(name='DocId', example='xx'),
                          docUuid?: string(name='DocUuid', example='xx'),
                          searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
                          summary?: string(name='Summary', example='xx'),
                          title?: string(name='Title', example='xx'),
                          url?: string(name='Url', example='xx'),
                        }(name='Article'),
                        clipInfos?: [ 
                          {
                            from?: double(name='From', example='1'),
                            score?: double(name='Score', example='0.9'),
                            text?: string(name='Text', example='xx'),
                            to?: double(name='To', example='1'),
                            type?: string(name='Type', example='asr'),
                          }
                        ](name='ClipInfos'),
                        fileUrl?: string(name='FileUrl', example='xx'),
                        mediaId?: string(name='MediaId', example='xx'),
                      }
                    ](name='SearchResult'),
                    size?: int32(name='Size', example='1'),
                    total?: int32(name='Total', example='1'),
                  }(name='VideoSearchResult'),
                }
              ](name='ClusterTopics'),
              generateFinished?: boolean(name='GenerateFinished', example='true'),
              textGenerate?: string(name='TextGenerate', example='xx'),
            }(name='ClusterTopicResult'),
            excerptResult?: {
              generateFinished?: boolean(name='GenerateFinished', example='true'),
              generateLevel?: string(name='GenerateLevel', example='concise'),
              reasonTextGenerate?: string(name='ReasonTextGenerate'),
              searchResult?: [ 
                {
                  chunks?: [ string ](name='Chunks'),
                  content?: string(name='Content', example='xx'),
                  docId?: string(name='DocId', example='xx'),
                  docUuid?: string(name='DocUuid', example='xx'),
                  excerpt?: string(name='Excerpt', example='xx'),
                  multimodalMedias?: [ 
                    {
                      fileUrl?: string(name='FileUrl', example='xx'),
                      mediaId?: string(name='MediaId', example='xx'),
                      mediaType?: string(name='MediaType', example='image'),
                    }
                  ](name='MultimodalMedias'),
                  pubTime?: string(name='PubTime', example='2023-04-04 08:39:09'),
                  score?: float(name='Score', example='0.99'),
                  searchSource?: string(name='SearchSource', example='QuarkCommonNews'),
                  searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
                  searchSourceType?: string(name='SearchSourceType', example='SystemSearch'),
                  select?: boolean(name='Select', example='true'),
                  summary?: string(name='Summary', example='xx'),
                  textGenerateMultimodalMediaList?: [ 
                    {
                      docUuid?: string(name='DocUuid', example='xx'),
                      end?: int32(name='End', example='1'),
                      multimodalMediaList?: [ 
                        {
                          article?: {
                            docId?: string(name='DocId', example='xx'),
                            docUuid?: string(name='DocUuid', example='xx'),
                            searchSourceName?: string(name='SearchSourceName', example='xxx'),
                            title?: string(name='Title', example='xx'),
                            url?: string(name='Url', example='xx'),
                          }(name='Article'),
                          fileUrl?: string(name='FileUrl', example='xx'),
                          mediaId?: string(name='MediaId', example='xx'),
                          mediaType?: string(name='MediaType', example='image'),
                        }
                      ](name='MultimodalMediaList'),
                      start?: int32(name='Start', example='1'),
                    }
                  ](name='TextGenerateMultimodalMediaList'),
                  title?: string(name='Title', example='xx'),
                  traceabilityId?: int32(name='TraceabilityId', example='1'),
                  url?: string(name='Url', example='xx'),
                }
              ](name='SearchResult'),
              textGenerate?: string(name='TextGenerate', example='xx'),
            }(name='ExcerptResult'),
            imageSearchResult?: {
              searchResult?: [ 
                {
                  article?: {
                    docId?: string(name='DocId', example='xx'),
                    docUuid?: string(name='DocUuid', example='xx'),
                    searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
                    summary?: string(name='Summary', example='xx'),
                    title?: string(name='Title', example='xx'),
                    url?: string(name='Url', example='xx'),
                  }(name='Article'),
                  fileUrl?: string(name='FileUrl', example='xx'),
                  mediaId?: string(name='MediaId', example='xx'),
                }
              ](name='SearchResult'),
            }(name='ImageSearchResult'),
            newsElementResult?: {
              generateFinished?: boolean(name='GenerateFinished', example='true'),
              newsElementArticleList?: [ 
                {
                  article?: {
                    content?: string(name='Content', example='xx'),
                    docId?: string(name='DocId', example='xx'),
                    docUuid?: string(name='DocUuid', example='xx'),
                    pubTime?: string(name='PubTime', example='2023-04-04 08:39:09'),
                    score?: float(name='Score', example='0.99'),
                    searchSource?: string(name='SearchSource', example='QuarkCommonNews'),
                    searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
                    searchSourceType?: string(name='SearchSourceType', example='SystemSearch'),
                    select?: boolean(name='Select', example='true'),
                    summary?: string(name='Summary', example='xx'),
                    title?: string(name='Title', example='xx'),
                    url?: string(name='Url', example='xx'),
                  }(name='Article'),
                  newsElementList?: [ 
                    {
                      event?: {
                        causeList?: [ string ](name='CauseList'),
                        processList?: [ string ](name='ProcessList'),
                        resultList?: [ string ](name='ResultList'),
                      }(name='Event', example='task-started'),
                      location?: string(name='Location', example='xx'),
                      people?: string(name='People', example='xx'),
                      time?: string(name='Time', example='时间'),
                    }
                  ](name='NewsElementList'),
                  textGenerate?: string(name='TextGenerate', example='xx'),
                }
              ](name='NewsElementArticleList'),
              textGenerate?: string(name='TextGenerate', example='x'),
            }(name='NewsElementResult'),
            textGenerateResult?: {
              generateFinished?: boolean(name='GenerateFinished', example='true'),
              generateLevel?: string(name='GenerateLevel', example='concise'),
              generateTraceability?: {
                coordinates?: [ 
                  {
                    generateCoordinate?: {
                      x?: int32(name='X', example='1'),
                      y?: int32(name='Y', example='1'),
                      z?: int32(name='Z', example='1'),
                    }(name='GenerateCoordinate'),
                    newsCoordinate?: {
                      x?: int32(name='X', example='1'),
                      y?: int32(name='Y', example='1'),
                      z?: int32(name='Z', example='1'),
                    }(name='NewsCoordinate'),
                  }
                ](name='Coordinates'),
                duplicate?: double(name='Duplicate', example='0.9'),
              }(name='GenerateTraceability'),
              multimodalSearchResultList?: [ 
                {
                  current?: int32(name='Current', example='1'),
                  searchQuery?: string(name='SearchQuery', example='xx'),
                  searchResult?: [ 
                    {
                      article?: {
                        docId?: string(name='DocId', example='xx'),
                        docUuid?: string(name='DocUuid', example='xx'),
                        searchSourceName?: string(name='SearchSourceName', example='xx'),
                        summary?: string(name='Summary', example='xx'),
                        title?: string(name='Title', example='xx'),
                        url?: string(name='Url', example='xx'),
                      }(name='Article'),
                      clipInfos?: [ 
                        {
                          from?: double(name='From', example='1'),
                          score?: double(name='Score', example='0.1'),
                          text?: string(name='Text', example='xx'),
                          to?: double(name='To', example='1'),
                          type?: string(name='Type', example='asr'),
                        }
                      ](name='ClipInfos'),
                      fileUrl?: string(name='FileUrl', example='xx'),
                      mediaId?: string(name='MediaId', example='xx'),
                      mediaType?: string(name='MediaType', example='image'),
                    }
                  ](name='SearchResult'),
                  searchType?: string(name='SearchType', example='realtime'),
                  size?: int32(name='Size', example='1'),
                  timelineDateStr?: string(name='TimelineDateStr', example='时间脉络-时间'),
                  total?: int32(name='Total', example='1'),
                }
              ](name='MultimodalSearchResultList'),
              reasonTextGenerate?: string(name='ReasonTextGenerate'),
              referenceList?: [ 
                {
                  chunks?: [ string ](name='Chunks'),
                  content?: string(name='Content', example='xx'),
                  docId?: string(name='DocId', example='xx'),
                  docUuid?: string(name='DocUuid', example='xx'),
                  pubTime?: string(name='PubTime', example='2023-04-04 08:39:09'),
                  score?: float(name='Score', example='0.99'),
                  searchSource?: string(name='SearchSource', example='QuarkCommonNews'),
                  searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
                  searchSourceType?: string(name='SearchSourceType', example='SystemSearch'),
                  select?: boolean(name='Select', example='true'),
                  source?: string(name='Source', example='新华社'),
                  summary?: string(name='Summary', example='xx'),
                  title?: string(name='Title', example='xx'),
                  traceabilityId?: int32(name='TraceabilityId', example='1'),
                  url?: string(name='Url', example='xx'),
                }
              ](name='ReferenceList'),
              textGenerate?: string(name='TextGenerate', example='xx'),
              textGenerateMultimodalMediaList?: [ 
                {
                  end?: int32(name='End', example='1'),
                  multimodalMediaList?: [ 
                    {
                      article?: {
                        docId?: string(name='DocId', example='xx'),
                        docUuid?: string(name='DocUuid', example='xx'),
                        searchSourceName?: string(name='SearchSourceName', example='xx'),
                        summary?: string(name='Summary', example='xx'),
                        title?: string(name='Title', example='xx'),
                        url?: string(name='Url', example='xx'),
                      }(name='Article'),
                      fileUrl?: string(name='FileUrl', example='xx'),
                      mediaId?: string(name='MediaId', example='xx'),
                      mediaType?: string(name='MediaType', example='image'),
                    }
                  ](name='MultimodalMediaList'),
                  start?: int32(name='Start', example='1'),
                }
              ](name='TextGenerateMultimodalMediaList'),
            }(name='TextGenerateResult'),
            textSearchResult?: {
              current?: int32(name='Current'),
              searchResult?: [ 
                {
                  content?: string(name='Content', example='xx'),
                  docId?: string(name='DocId', example='xx'),
                  docUuid?: string(name='DocUuid', example='xx'),
                  pubTime?: string(name='PubTime', example='2024-11-25 14:25:59'),
                  searchSource?: string(name='SearchSource', example='QuarkCommonNews'),
                  searchSourceName?: string(name='SearchSourceName', example='xxx'),
                  searchSourceType?: string(name='SearchSourceType', example='SystemSearch'),
                  summary?: string(name='Summary', example='xx'),
                  title?: string(name='Title', example='xx'),
                  url?: string(name='Url', example='xx'),
                }
              ](name='SearchResult'),
              size?: int32(name='Size'),
              total?: int32(name='Total'),
            }(name='TextSearchResult'),
            timelineResult?: {
              generateFinished?: boolean(name='GenerateFinished', example='true'),
              generateTraceability?: {
                coordinates?: [ 
                  {
                    generateCoordinate?: {
                      x?: int32(name='X', example='1'),
                      y?: int32(name='Y', example='1'),
                      z?: int32(name='Z', example='1'),
                    }(name='GenerateCoordinate'),
                    newsCoordinate?: {
                      x?: int32(name='X', example='1'),
                      y?: int32(name='Y', example='1'),
                      z?: int32(name='Z', example='1'),
                    }(name='NewsCoordinate'),
                  }
                ](name='Coordinates'),
                duplicate?: double(name='Duplicate', example='0.9'),
              }(name='GenerateTraceability'),
              multimodalSearchResultList?: [ 
                {
                  searchResult?: [ 
                    {
                      article?: {
                        docId?: string(name='DocId', example='xx'),
                        docUuid?: string(name='DocUuid', example='xx'),
                        searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
                        summary?: string(name='Summary', example='xx'),
                        title?: string(name='Title', example='xx'),
                        url?: string(name='Url', example='xx'),
                      }(name='Article'),
                      clipInfos?: [ 
                        {
                          from?: double(name='From', example='1'),
                          score?: double(name='Score', example='0.99'),
                          text?: string(name='Text', example='xx'),
                          to?: double(name='To', example='1'),
                          type?: string(name='Type', example='asr'),
                        }
                      ](name='ClipInfos'),
                      fileUrl?: string(name='FileUrl', example='xx'),
                      mediaId?: string(name='MediaId', example='xx'),
                      mediaType?: string(name='MediaType', example='image'),
                    }
                  ](name='SearchResult'),
                  timelineDateStr?: string(name='TimelineDateStr', example='2024-09-11'),
                }
              ](name='MultimodalSearchResultList'),
              reasonTextGenerate?: string(name='ReasonTextGenerate'),
              referenceList?: [ 
                {
                  chunks?: [ string ](name='Chunks'),
                  content?: string(name='Content', example='xx'),
                  docId?: string(name='DocId', example='xx'),
                  docUuid?: string(name='DocUuid', example='xx'),
                  pubTime?: string(name='PubTime', example='2023-04-04 08:39:09'),
                  score?: float(name='Score', example='0.99'),
                  searchSource?: string(name='SearchSource', example='QuarkCommonNews'),
                  searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
                  searchSourceType?: string(name='SearchSourceType', example='SystemSearch'),
                  select?: boolean(name='Select', example='true'),
                  source?: string(name='Source', example='新华社'),
                  summary?: string(name='Summary', example='xx'),
                  title?: string(name='Title', example='xx'),
                  traceabilityId?: int32(name='TraceabilityId', example='1'),
                  url?: string(name='Url', example='xx'),
                }
              ](name='ReferenceList'),
              textGenerate?: string(name='TextGenerate', example='xx'),
              textGenerateMultimodalMediaList?: [ 
                {
                  end?: int32(name='End', example='1'),
                  multimodalMediaList?: [ 
                    {
                      article?: {
                        docId?: string(name='DocId', example='xx'),
                        docUuid?: string(name='DocUuid', example='xx'),
                        searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
                        summary?: string(name='Summary', example='xx'),
                        title?: string(name='Title', example='xxxx'),
                        url?: string(name='Url', example='xx'),
                      }(name='Article'),
                      fileUrl?: string(name='FileUrl', example='xx'),
                      mediaId?: string(name='MediaId', example='xx'),
                      mediaType?: string(name='MediaType', example='image'),
                    }
                  ](name='MultimodalMediaList'),
                  start?: int32(name='Start', example='1'),
                }
              ](name='TextGenerateMultimodalMediaList'),
            }(name='TimelineResult'),
            videoSearchResult?: {
              searchResult?: [ 
                {
                  article?: {
                    docId?: string(name='DocId', example='xx'),
                    docUuid?: string(name='DocUuid', example='xx'),
                    searchSourceName?: string(name='SearchSourceName', example='互联网搜索'),
                    summary?: string(name='Summary', example='xx'),
                    title?: string(name='Title', example='xx'),
                    url?: string(name='Url', example='xx'),
                  }(name='Article'),
                  clipInfos?: [ 
                    {
                      from?: double(name='From', example='1'),
                      score?: double(name='Score', example='0.8'),
                      text?: string(name='Text', example='xx'),
                      to?: double(name='To', example='1'),
                      type?: string(name='Type', example='asr'),
                    }
                  ](name='ClipInfos'),
                  fileUrl?: string(name='FileUrl', example='xx'),
                  mediaId?: string(name='MediaId', example='xx'),
                }
              ](name='SearchResult'),
            }(name='VideoSearchResult'),
          }(name='GeneratedContent'),
          modelId?: string(name='ModelId'),
          nextStep?: string(name='NextStep', example='search'),
          recommendSearchQueryList?: [ string ](name='RecommendSearchQueryList'),
          searchKeywords?: [ string ](name='SearchKeywords'),
          searchQueryList?: [ string ](name='SearchQueryList'),
          supplementDataType?: string(name='SupplementDataType', example='searchQuery'),
          supplementEnable?: boolean(name='SupplementEnable', example='true'),
          tokenCalculate?: {
            firstTokenTime?: float(name='FirstTokenTime'),
            outputAvgTime?: float(name='OutputAvgTime'),
            searchTime?: float(name='SearchTime'),
            time?: float(name='Time'),
            totalTokens?: long(name='TotalTokens'),
          }(name='TokenCalculate'),
        }(name='BizContext'),
      }(name='AgentContext'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='1'),
      outputTokens?: long(name='OutputTokens', example='2'),
      totalTokens?: long(name='TotalTokens', example='3'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='xx'),
}

model RunSearchGenerationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunSearchGenerationResponseBody(name='body'),
}

/**
 * @summary AI妙搜-智能搜索生成
 *
 * @param tmpReq RunSearchGenerationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunSearchGenerationResponse
 */
async function runSearchGenerationWithOptions(tmpReq: RunSearchGenerationRequest, runtime: $RuntimeOptions): RunSearchGenerationResponse {
  tmpReq.validate();
  var request = new RunSearchGenerationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.agentContext)) {
    request.agentContextShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentContext, 'AgentContext', 'json');
  }
  if (!$isNull(tmpReq.chatConfig)) {
    request.chatConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.chatConfig, 'ChatConfig', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.agentContextShrink)) {
    body['AgentContext'] = request.agentContextShrink;
  }
  if (!$isNull(request.chatConfigShrink)) {
    body['ChatConfig'] = request.chatConfigShrink;
  }
  if (!$isNull(request.modelId)) {
    body['ModelId'] = request.modelId;
  }
  if (!$isNull(request.originalSessionId)) {
    body['OriginalSessionId'] = request.originalSessionId;
  }
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunSearchGeneration',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary AI妙搜-智能搜索生成
 *
 * @param request RunSearchGenerationRequest
 * @return RunSearchGenerationResponse
 */
async function runSearchGeneration(request: RunSearchGenerationRequest): RunSearchGenerationResponse {
  var runtime = new $RuntimeOptions{};
  return runSearchGenerationWithOptions(request, runtime);
}

model RunSearchSimilarArticlesRequest {
  chatConfig?: {
    searchParam?: {
      searchSources?: [ 
        {
          code?: string(name='Code', example='SystemSearch'),
          datasetName?: string(name='DatasetName'),
          name?: string(name='Name'),
        }
      ](name='SearchSources'),
    }(name='SearchParam'),
  }(name='ChatConfig'),
  docType?: string(name='DocType', example='html'),
  title?: string(name='Title'),
  url?: string(name='Url', description='This parameter is required.', example='https://xxx/xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model RunSearchSimilarArticlesShrinkRequest {
  chatConfigShrink?: string(name='ChatConfig'),
  docType?: string(name='DocType', example='html'),
  title?: string(name='Title'),
  url?: string(name='Url', description='This parameter is required.', example='https://xxx/xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model RunSearchSimilarArticlesResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='错误码'),
    errorMessage?: string(name='ErrorMessage', example='错误信息'),
    event?: string(name='Event', example='task-started'),
    sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  }(name='Header'),
  payload?: {
    output?: {
      articles?: [ 
        {
          docId?: string(name='DocId'),
          docUuid?: string(name='DocUuid', example='a26c2c1'),
          pubTime?: string(name='PubTime', example='2025-01-16 18:07:22'),
          searchSourceName?: string(name='SearchSourceName'),
          source?: string(name='Source', example='xxx.com'),
          summary?: string(name='Summary', example='xxx'),
          title?: string(name='Title'),
          url?: string(name='Url', example='https://xxx'),
        }
      ](name='Articles'),
      text?: string(name='Text', example='文本生成结果'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='81'),
      outputTokens?: long(name='OutputTokens', example='9'),
      totalTokens?: long(name='TotalTokens', example='50'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model RunSearchSimilarArticlesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunSearchSimilarArticlesResponseBody(name='body'),
}

/**
 * @summary 妙搜-文搜文
 *
 * @param tmpReq RunSearchSimilarArticlesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunSearchSimilarArticlesResponse
 */
async function runSearchSimilarArticlesWithOptions(tmpReq: RunSearchSimilarArticlesRequest, runtime: $RuntimeOptions): RunSearchSimilarArticlesResponse {
  tmpReq.validate();
  var request = new RunSearchSimilarArticlesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.chatConfig)) {
    request.chatConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.chatConfig, 'ChatConfig', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.chatConfigShrink)) {
    body['ChatConfig'] = request.chatConfigShrink;
  }
  if (!$isNull(request.docType)) {
    body['DocType'] = request.docType;
  }
  if (!$isNull(request.title)) {
    body['Title'] = request.title;
  }
  if (!$isNull(request.url)) {
    body['Url'] = request.url;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunSearchSimilarArticles',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙搜-文搜文
 *
 * @param request RunSearchSimilarArticlesRequest
 * @return RunSearchSimilarArticlesResponse
 */
async function runSearchSimilarArticles(request: RunSearchSimilarArticlesRequest): RunSearchSimilarArticlesResponse {
  var runtime = new $RuntimeOptions{};
  return runSearchSimilarArticlesWithOptions(request, runtime);
}

model RunStepByStepWritingRequest {
  originSessionId?: string(name='OriginSessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  prompt?: string(name='Prompt', description='This parameter is required.', example='提示词'),
  referenceData?: {
    articles?: [ 
      {
        author?: string(name='Author', example='作者'),
        content?: string(name='Content', example='文章内容'),
        docId?: string(name='DocId', example='文档-自定义的唯一ID'),
        docUuid?: string(name='DocUuid', example='8a20e007a6174522af4d6a2657d5526f'),
        mediaUrl?: string(name='MediaUrl', example='http://www.example.com'),
        pubTime?: string(name='PubTime', example='2024-09-10 14:17:54'),
        source?: string(name='Source', example='央视网'),
        summary?: string(name='Summary', example='文章摘要'),
        tag?: string(name='Tag', example='文章标签'),
        title?: string(name='Title', example='文章标题'),
        url?: string(name='Url', example='https://www.example.com/aaa.docx'),
      }
    ](name='Articles'),
    miniDoc?: [ string ](name='MiniDoc'),
    outlines?: [ 
      {
        articles?: [ 
          {
            content?: string(name='Content', example='文章内容'),
            title?: string(name='Title', example='文章标题'),
            url?: string(name='Url', example='文章链接'),
          }
        ](name='Articles'),
        outline?: string(name='Outline', example='大纲'),
      }
    ](name='Outlines'),
    summarization?: [ string ](name='Summarization'),
  }(name='ReferenceData'),
  sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
  writingConfig?: {
    domain?: string(name='Domain', example='media'),
    keywords?: [ string ](name='Keywords'),
    promptTag?: {
      necessaryTips?: string(name='NecessaryTips', example='必要提示'),
      position?: string(name='Position', example='立场'),
      reverseWords?: string(name='ReverseWords', example='反向词'),
      theme?: string(name='Theme', example='主题'),
    }(name='PromptTag'),
    scene?: string(name='Scene', example='分步骤写作场景，传媒写作支持的写作场景:新闻写作(默认),新闻评论,通用文体，公文写作支持的写作场景:通知(默认),通告,通报,请示,决定,函,通用文体'),
    step?: string(name='Step', example='Writing'),
    summaryReturnType?: string(name='SummaryReturnType'),
    tags?: [ 
      {
        keyword?: string(name='Keyword', example='10'),
        tag?: string(name='Tag', example='gcNumberSizeTag'),
      }
    ](name='Tags'),
    useSearch?: boolean(name='UseSearch', example='true'),
  }(name='WritingConfig'),
}

model RunStepByStepWritingShrinkRequest {
  originSessionId?: string(name='OriginSessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  prompt?: string(name='Prompt', description='This parameter is required.', example='提示词'),
  referenceDataShrink?: string(name='ReferenceData'),
  sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
  writingConfigShrink?: string(name='WritingConfig'),
}

model RunStepByStepWritingResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='错误码'),
    errorMessage?: string(name='ErrorMessage', example='错误信息'),
    event?: string(name='Event', example='task-started'),
    originSessionId?: string(name='OriginSessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    traceId?: string(name='TraceId', example='全链路ID'),
  }(name='Header'),
  payload?: {
    output?: {
      articles?: [ 
        {
          author?: string(name='Author', example='作者'),
          content?: string(name='Content', example='文章内容'),
          docId?: string(name='DocId', example='文档-自定义的唯一ID'),
          docUuid?: string(name='DocUuid', example='f1da53894e784759946d22e2cb2b522a'),
          mediaUrl?: string(name='MediaUrl', example='http://www.example.com'),
          pubTime?: string(name='PubTime', example='2024-09-10 14:17:53'),
          source?: string(name='Source', example='央视网'),
          summary?: string(name='Summary', example='文章摘要'),
          tag?: string(name='Tag', example='文章标签'),
          title?: string(name='Title', example='文章标题'),
          url?: string(name='Url', example='https://www.example.com/aaa.docx'),
        }
      ](name='Articles'),
      extraOutput?: {
        summarization?: [ string ](name='summarization'),
      }(name='ExtraOutput'),
      miniDoc?: [ string ](name='MiniDoc', example='文章精排之后的片段'),
      searchQuery?: string(name='SearchQuery', example='大模型改变世界'),
      text?: string(name='Text', example='文本生成结果'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='65'),
      outputTokens?: long(name='OutputTokens', example='80'),
      totalTokens?: long(name='TotalTokens', example='32'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model RunStepByStepWritingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunStepByStepWritingResponseBody(name='body'),
}

/**
 * @summary 创作-分步骤写作
 *
 * @param tmpReq RunStepByStepWritingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunStepByStepWritingResponse
 */
async function runStepByStepWritingWithOptions(tmpReq: RunStepByStepWritingRequest, runtime: $RuntimeOptions): RunStepByStepWritingResponse {
  tmpReq.validate();
  var request = new RunStepByStepWritingShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.referenceData)) {
    request.referenceDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.referenceData, 'ReferenceData', 'json');
  }
  if (!$isNull(tmpReq.writingConfig)) {
    request.writingConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.writingConfig, 'WritingConfig', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.originSessionId)) {
    body['OriginSessionId'] = request.originSessionId;
  }
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.referenceDataShrink)) {
    body['ReferenceData'] = request.referenceDataShrink;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  if (!$isNull(request.writingConfigShrink)) {
    body['WritingConfig'] = request.writingConfigShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunStepByStepWriting',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创作-分步骤写作
 *
 * @param request RunStepByStepWritingRequest
 * @return RunStepByStepWritingResponse
 */
async function runStepByStepWriting(request: RunStepByStepWritingRequest): RunStepByStepWritingResponse {
  var runtime = new $RuntimeOptions{};
  return runStepByStepWritingWithOptions(request, runtime);
}

model RunStyleFeatureAnalysisRequest {
  contents?: [ string ](name='Contents'),
  materialIds?: [ long ](name='MaterialIds'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model RunStyleFeatureAnalysisShrinkRequest {
  contentsShrink?: string(name='Contents'),
  materialIdsShrink?: string(name='MaterialIds'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model RunStyleFeatureAnalysisResponseBody = {
  end?: boolean(name='End'),
  header?: {
    errorCode?: string(name='ErrorCode', example='403'),
    errorMessage?: string(name='ErrorMessage', example='Pop sign mismatch, please check.'),
    event?: string(name='Event', example='result-generated'),
    eventInfo?: string(name='EventInfo', example='模型生成事件'),
    sessionId?: string(name='SessionId', example='3cd10828-0e42-471c-8f1a-931cde20b035'),
    taskId?: string(name='TaskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='TraceId', example='2150451a17191950923411783e2927'),
  }(name='Header'),
  payload?: {
    output?: {
      text?: string(name='Text', example='这是测试输出'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
}

model RunStyleFeatureAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunStyleFeatureAnalysisResponseBody(name='body'),
}

/**
 * @summary 内容特点分析
 *
 * @param tmpReq RunStyleFeatureAnalysisRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunStyleFeatureAnalysisResponse
 */
async function runStyleFeatureAnalysisWithOptions(tmpReq: RunStyleFeatureAnalysisRequest, runtime: $RuntimeOptions): RunStyleFeatureAnalysisResponse {
  tmpReq.validate();
  var request = new RunStyleFeatureAnalysisShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.contents)) {
    request.contentsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.contents, 'Contents', 'json');
  }
  if (!$isNull(tmpReq.materialIds)) {
    request.materialIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.materialIds, 'MaterialIds', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.contentsShrink)) {
    body['Contents'] = request.contentsShrink;
  }
  if (!$isNull(request.materialIdsShrink)) {
    body['MaterialIds'] = request.materialIdsShrink;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunStyleFeatureAnalysis',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 内容特点分析
 *
 * @param request RunStyleFeatureAnalysisRequest
 * @return RunStyleFeatureAnalysisResponse
 */
async function runStyleFeatureAnalysis(request: RunStyleFeatureAnalysisRequest): RunStyleFeatureAnalysisResponse {
  var runtime = new $RuntimeOptions{};
  return runStyleFeatureAnalysisWithOptions(request, runtime);
}

model RunSummaryGenerateRequest {
  content?: string(name='Content', description='This parameter is required.', example='创新政务社交媒体功能。鼓励各地区、各部门结合实际，开发政务社交媒体的特色功能，如在线咨询服务、政策解读、互动问答等，增强政务社交媒体的互动性和实用性，提升公众参与度。'),
  prompt?: string(name='Prompt', example='请为上述内容生成一段摘要，字数在100~200字以内。'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-2setzb9x4ewsd'),
}

model RunSummaryGenerateResponseBody = {
  end?: boolean(name='End'),
  header?: {
    errorCode?: string(name='ErrorCode', example='403'),
    errorMessage?: string(name='ErrorMessage', example='Pop sign mismatch, please check.'),
    event?: string(name='Event', example='result-generated'),
    eventInfo?: string(name='EventInfo', example='模型生成事件'),
    sessionId?: string(name='SessionId', example='3cd10828-0e42-471c-8f1a-931cde20b035'),
    taskId?: string(name='TaskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='TraceId', example='2150451a17191950923411783e2927'),
  }(name='Header'),
  payload?: {
    output?: {
      text?: string(name='Text', example='这是测试输出'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='100'),
      outputTokens?: long(name='OutputTokens', example='100'),
      totalTokens?: long(name='TotalTokens', example='200'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
}

model RunSummaryGenerateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunSummaryGenerateResponseBody(name='body'),
}

/**
 * @summary 内容摘要生成
 *
 * @param request RunSummaryGenerateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunSummaryGenerateResponse
 */
async function runSummaryGenerateWithOptions(request: RunSummaryGenerateRequest, runtime: $RuntimeOptions): RunSummaryGenerateResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.content)) {
    body['Content'] = request.content;
  }
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunSummaryGenerate',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 内容摘要生成
 *
 * @param request RunSummaryGenerateRequest
 * @return RunSummaryGenerateResponse
 */
async function runSummaryGenerate(request: RunSummaryGenerateRequest): RunSummaryGenerateResponse {
  var runtime = new $RuntimeOptions{};
  return runSummaryGenerateWithOptions(request, runtime);
}

model RunTextPolishingRequest {
  content?: string(name='Content', description='This parameter is required.', example='文本内容'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model RunTextPolishingResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='错误码'),
    errorMessage?: string(name='ErrorMessage', example='错误信息'),
    event?: string(name='Event', example='task-started'),
    originSessionId?: string(name='OriginSessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    traceId?: string(name='TraceId', example='全链路ID'),
  }(name='Header'),
  payload?: {
    output?: {
      text?: string(name='Text', example='文本生成结果'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='1'),
      outputTokens?: long(name='OutputTokens', example='1'),
      totalTokens?: long(name='TotalTokens', example='2'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model RunTextPolishingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunTextPolishingResponseBody(name='body'),
}

/**
 * @summary 创作-文本润色
 *
 * @param request RunTextPolishingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunTextPolishingResponse
 */
async function runTextPolishingWithOptions(request: RunTextPolishingRequest, runtime: $RuntimeOptions): RunTextPolishingResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.content)) {
    body['Content'] = request.content;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunTextPolishing',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创作-文本润色
 *
 * @param request RunTextPolishingRequest
 * @return RunTextPolishingResponse
 */
async function runTextPolishing(request: RunTextPolishingRequest): RunTextPolishingResponse {
  var runtime = new $RuntimeOptions{};
  return runTextPolishingWithOptions(request, runtime);
}

model RunTitleGenerationRequest {
  deduplicatedTitles?: [ string ](name='DeduplicatedTitles'),
  referenceData?: {
    contents?: [ string ](name='Contents', description='This parameter is required.'),
  }(name='ReferenceData', description='This parameter is required.'),
  taskId?: string(name='TaskId', example='xxxx'),
  titleCount?: string(name='TitleCount'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunTitleGenerationShrinkRequest {
  deduplicatedTitlesShrink?: string(name='DeduplicatedTitles'),
  referenceDataShrink?: string(name='ReferenceData', description='This parameter is required.'),
  taskId?: string(name='TaskId', example='xxxx'),
  titleCount?: string(name='TitleCount'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunTitleGenerationResponseBody = {
  code?: string(name='Code'),
  header?: {
    errorCode?: string(name='ErrorCode', example='AccessForbid'),
    errorMessage?: string(name='ErrorMessage', example='xxx'),
    event?: string(name='Event', example='task-failed'),
    sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    statusCode?: int32(name='StatusCode'),
    taskId?: string(name='TaskId', example='50a1cc8e-717e-4a2b-a76b-dc9734a8564b'),
    traceId?: string(name='TraceId', example='0a3d448f17000139741898287e0eb3'),
  }(name='Header'),
  httpStatusCode?: string(name='HttpStatusCode'),
  message?: string(name='Message'),
  payload?: {
    output?: {
      text?: string(name='Text', example='xxx'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='1'),
      outputTokens?: long(name='OutputTokens', example='1'),
      totalTokens?: long(name='TotalTokens', example='2'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='94512A33-8EC1-5452-A793-5C91F18ED2F0'),
  success?: boolean(name='Success'),
}

model RunTitleGenerationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunTitleGenerationResponseBody(name='body'),
}

/**
 * @summary 妙笔：标题生成
 *
 * @param tmpReq RunTitleGenerationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunTitleGenerationResponse
 */
async function runTitleGenerationWithOptions(tmpReq: RunTitleGenerationRequest, runtime: $RuntimeOptions): RunTitleGenerationResponse {
  tmpReq.validate();
  var request = new RunTitleGenerationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.deduplicatedTitles)) {
    request.deduplicatedTitlesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.deduplicatedTitles, 'DeduplicatedTitles', 'json');
  }
  if (!$isNull(tmpReq.referenceData)) {
    request.referenceDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.referenceData, 'ReferenceData', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.deduplicatedTitlesShrink)) {
    body['DeduplicatedTitles'] = request.deduplicatedTitlesShrink;
  }
  if (!$isNull(request.referenceDataShrink)) {
    body['ReferenceData'] = request.referenceDataShrink;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.titleCount)) {
    body['TitleCount'] = request.titleCount;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunTitleGeneration',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙笔：标题生成
 *
 * @param request RunTitleGenerationRequest
 * @return RunTitleGenerationResponse
 */
async function runTitleGeneration(request: RunTitleGenerationRequest): RunTitleGenerationResponse {
  var runtime = new $RuntimeOptions{};
  return runTitleGenerationWithOptions(request, runtime);
}

model RunTranslateGenerationRequest {
  prompt?: string(name='Prompt', description='This parameter is required.', example='toEnglish'),
  referenceData?: {
    contents?: [ string ](name='Contents', description='This parameter is required.'),
  }(name='ReferenceData', description='This parameter is required.'),
  taskId?: string(name='TaskId', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunTranslateGenerationShrinkRequest {
  prompt?: string(name='Prompt', description='This parameter is required.', example='toEnglish'),
  referenceDataShrink?: string(name='ReferenceData', description='This parameter is required.'),
  taskId?: string(name='TaskId', example='xxx'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunTranslateGenerationResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='AccessForbid'),
    errorMessage?: string(name='ErrorMessage', example='xx'),
    event?: string(name='Event', example='task-failed'),
    sessionId?: string(name='SessionId', example='91C2B2B8-7D12-4A8D-A724-1E576D30C096'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    traceId?: string(name='TraceId', example='0abb781d17146157564845243e20b5'),
  }(name='Header'),
  payload?: {
    output?: {
      text?: string(name='Text', example='xx'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='1'),
      outputTokens?: long(name='OutputTokens', example='1'),
      totalTokens?: long(name='TotalTokens', example='2'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='DA021073-17CE-5CCF-9FEB-93226C766887'),
}

model RunTranslateGenerationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunTranslateGenerationResponseBody(name='body'),
}

/**
 * @summary AI妙笔-创作-中英文翻译
 *
 * @param tmpReq RunTranslateGenerationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunTranslateGenerationResponse
 */
async function runTranslateGenerationWithOptions(tmpReq: RunTranslateGenerationRequest, runtime: $RuntimeOptions): RunTranslateGenerationResponse {
  tmpReq.validate();
  var request = new RunTranslateGenerationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.referenceData)) {
    request.referenceDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.referenceData, 'ReferenceData', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.referenceDataShrink)) {
    body['ReferenceData'] = request.referenceDataShrink;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunTranslateGeneration',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary AI妙笔-创作-中英文翻译
 *
 * @param request RunTranslateGenerationRequest
 * @return RunTranslateGenerationResponse
 */
async function runTranslateGeneration(request: RunTranslateGenerationRequest): RunTranslateGenerationResponse {
  var runtime = new $RuntimeOptions{};
  return runTranslateGenerationWithOptions(request, runtime);
}

model RunWriteToneGenerationRequest {
  prompt?: string(name='Prompt', description='This parameter is required.'),
  referenceData?: {
    contents?: [ string ](name='Contents', description='This parameter is required.'),
  }(name='ReferenceData', description='This parameter is required.'),
  taskId?: string(name='TaskId', example='7AA2AE16-D873-5C5F-9708-15396C382EB1'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunWriteToneGenerationShrinkRequest {
  prompt?: string(name='Prompt', description='This parameter is required.'),
  referenceDataShrink?: string(name='ReferenceData', description='This parameter is required.'),
  taskId?: string(name='TaskId', example='7AA2AE16-D873-5C5F-9708-15396C382EB1'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-xxx'),
}

model RunWriteToneGenerationResponseBody = {
  header?: {
    errorCode?: string(name='ErrorCode', example='AccessForbid'),
    errorMessage?: string(name='ErrorMessage', example='xxx'),
    event?: string(name='Event', example='task-failed'),
    sessionId?: string(name='SessionId', example='F1953EE6-157C-40DC-BBF1-87C98AC27C51'),
    taskId?: string(name='TaskId', example='F1953EE6-157C-40DC-BBF1-87C98AC27C51'),
    traceId?: string(name='TraceId', example='F1953EE6-157C-40DC-BBF1-87C98AC27C51'),
  }(name='Header'),
  payload?: {
    output?: {
      text?: string(name='Text', example='xxx'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='1'),
      outputTokens?: long(name='OutputTokens', example='1'),
      totalTokens?: long(name='TotalTokens', example='2'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='FB698445-61DA-5361-BF73-1C5F1157E888'),
}

model RunWriteToneGenerationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunWriteToneGenerationResponseBody(name='body'),
}

/**
 * @summary AI妙笔-创作-文风改写
 *
 * @param tmpReq RunWriteToneGenerationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunWriteToneGenerationResponse
 */
async function runWriteToneGenerationWithOptions(tmpReq: RunWriteToneGenerationRequest, runtime: $RuntimeOptions): RunWriteToneGenerationResponse {
  tmpReq.validate();
  var request = new RunWriteToneGenerationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.referenceData)) {
    request.referenceDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.referenceData, 'ReferenceData', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.referenceDataShrink)) {
    body['ReferenceData'] = request.referenceDataShrink;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunWriteToneGeneration',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary AI妙笔-创作-文风改写
 *
 * @param request RunWriteToneGenerationRequest
 * @return RunWriteToneGenerationResponse
 */
async function runWriteToneGeneration(request: RunWriteToneGenerationRequest): RunWriteToneGenerationResponse {
  var runtime = new $RuntimeOptions{};
  return runWriteToneGenerationWithOptions(request, runtime);
}

model RunWritingRequest {
  originSessionId?: string(name='OriginSessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  prompt?: string(name='Prompt', description='This parameter is required.', example='提示词'),
  referenceData?: {
    articles?: [ 
      {
        author?: string(name='Author', example='作者'),
        content?: string(name='Content', example='文章内容'),
        docId?: string(name='DocId', example='文档-自定义的唯一ID'),
        docUuid?: string(name='DocUuid', example='2124ca4d48a542d788aa86151e1a8c8b'),
        pubTime?: string(name='PubTime', example='2024-08-28 11:38:28'),
        source?: string(name='Source', example='央视网'),
        summary?: string(name='Summary', example='文章摘要'),
        tag?: string(name='Tag', example='文章标签'),
        title?: string(name='Title', example='文章标题'),
        url?: string(name='Url', example='https://www.example.com/aaa.docx'),
      }
    ](name='Articles'),
  }(name='ReferenceData'),
  sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
  writingConfig?: {
    domain?: string(name='Domain', example='写作领域，media:传媒,government:政务,market:营销'),
    promptTag?: {
      necessaryTips?: string(name='NecessaryTips', example='必要提示'),
      position?: string(name='Position', example='立场'),
      reverseWords?: string(name='ReverseWords', example='反向词'),
      theme?: string(name='Theme', example='主题'),
    }(name='PromptTag'),
    tags?: [ 
      {
        keyword?: string(name='Keyword', example='10'),
        tag?: string(name='Tag', example='gcNumberSizeTag'),
      }
    ](name='Tags'),
    useSearch?: boolean(name='UseSearch', example='true'),
  }(name='WritingConfig'),
}

model RunWritingShrinkRequest {
  originSessionId?: string(name='OriginSessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  prompt?: string(name='Prompt', description='This parameter is required.', example='提示词'),
  referenceDataShrink?: string(name='ReferenceData'),
  sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
  writingConfigShrink?: string(name='WritingConfig'),
}

model RunWritingResponseBody = {
  end?: boolean(name='End'),
  header?: {
    errorCode?: string(name='ErrorCode', example='错误码'),
    errorMessage?: string(name='ErrorMessage', example='错误信息'),
    event?: string(name='Event', example='task-started'),
    originSessionId?: string(name='OriginSessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    sessionId?: string(name='SessionId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    statusCode?: int32(name='StatusCode', example='400'),
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    traceId?: string(name='TraceId', example='全链路ID'),
  }(name='Header'),
  payload?: {
    output?: {
      articles?: [ 
        {
          author?: string(name='Author', example='作者'),
          content?: string(name='Content', example='文章内容'),
          docId?: string(name='DocId', example='文档-自定义的唯一ID'),
          docUuid?: string(name='DocUuid', example='98229f6001cf4deeb1668191d4eccc75'),
          pubTime?: string(name='PubTime', example='2024-08-28 11:38:28'),
          source?: string(name='Source', example='央视网'),
          summary?: string(name='Summary', example='文章摘要'),
          tag?: string(name='Tag', example='文章标签'),
          title?: string(name='Title', example='文章标题'),
          url?: string(name='Url', example='https://www.example.com/aaa.docx'),
        }
      ](name='Articles'),
      miniDoc?: [ string ](name='MiniDoc', example='文章精排之后的片段'),
      searchQuery?: string(name='SearchQuery', example='大模型改变世界'),
      text?: string(name='Text', example='文本生成结果'),
    }(name='Output'),
    usage?: {
      inputTokens?: long(name='InputTokens', example='1'),
      outputTokens?: long(name='OutputTokens', example='1'),
      tokenMap?: map[string]long(name='TokenMap'),
      totalTokens?: long(name='TotalTokens', example='2'),
    }(name='Usage'),
  }(name='Payload'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model RunWritingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunWritingResponseBody(name='body'),
}

/**
 * @summary 直接写作
 *
 * @param tmpReq RunWritingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunWritingResponse
 */
async function runWritingWithOptions(tmpReq: RunWritingRequest, runtime: $RuntimeOptions): RunWritingResponse {
  tmpReq.validate();
  var request = new RunWritingShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.referenceData)) {
    request.referenceDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.referenceData, 'ReferenceData', 'json');
  }
  if (!$isNull(tmpReq.writingConfig)) {
    request.writingConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.writingConfig, 'WritingConfig', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.originSessionId)) {
    body['OriginSessionId'] = request.originSessionId;
  }
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.referenceDataShrink)) {
    body['ReferenceData'] = request.referenceDataShrink;
  }
  if (!$isNull(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  if (!$isNull(request.writingConfigShrink)) {
    body['WritingConfig'] = request.writingConfigShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunWriting',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 直接写作
 *
 * @param request RunWritingRequest
 * @return RunWritingResponse
 */
async function runWriting(request: RunWritingRequest): RunWritingResponse {
  var runtime = new $RuntimeOptions{};
  return runWritingWithOptions(request, runtime);
}

model SaveCustomTextRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  commodityCode?: string(name='CommodityCode', example='商品code'),
  content?: string(name='Content', example='内容'),
  title?: string(name='Title', example='标题'),
}

model SaveCustomTextResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: long(name='Data', example='5'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model SaveCustomTextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveCustomTextResponseBody(name='body'),
}

/**
 * @summary 保存自定义文本
 *
 * @param request SaveCustomTextRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SaveCustomTextResponse
 */
async function saveCustomTextWithOptions(request: SaveCustomTextRequest, runtime: $RuntimeOptions): SaveCustomTextResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.commodityCode)) {
    body['CommodityCode'] = request.commodityCode;
  }
  if (!$isNull(request.content)) {
    body['Content'] = request.content;
  }
  if (!$isNull(request.title)) {
    body['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SaveCustomText',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 保存自定义文本
 *
 * @param request SaveCustomTextRequest
 * @return SaveCustomTextResponse
 */
async function saveCustomText(request: SaveCustomTextRequest): SaveCustomTextResponse {
  var runtime = new $RuntimeOptions{};
  return saveCustomTextWithOptions(request, runtime);
}

model SaveDataSourceOrderConfigRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
  productCode?: string(name='ProductCode', description='This parameter is required.', example='miaobi'),
  userConfigDataSourceList?: [ 
    {
      code?: string(name='Code', description='This parameter is required.', example='QuarkCommonNews'),
      name?: string(name='Name'),
      number?: int32(name='Number', description='This parameter is required.', example='20'),
      type?: string(name='Type', description='This parameter is required.', example='SystemSearch'),
    }
  ](name='UserConfigDataSourceList', description='This parameter is required.'),
}

model SaveDataSourceOrderConfigShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
  productCode?: string(name='ProductCode', description='This parameter is required.', example='miaobi'),
  userConfigDataSourceListShrink?: string(name='UserConfigDataSourceList', description='This parameter is required.'),
}

model SaveDataSourceOrderConfigResponseBody = {
  code?: string(name='Code', example='200'),
  data?: boolean(name='Data', example='true'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model SaveDataSourceOrderConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveDataSourceOrderConfigResponseBody(name='body'),
}

/**
 * @summary 保存用户的信源配置
 *
 * @param tmpReq SaveDataSourceOrderConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SaveDataSourceOrderConfigResponse
 */
async function saveDataSourceOrderConfigWithOptions(tmpReq: SaveDataSourceOrderConfigRequest, runtime: $RuntimeOptions): SaveDataSourceOrderConfigResponse {
  tmpReq.validate();
  var request = new SaveDataSourceOrderConfigShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.userConfigDataSourceList)) {
    request.userConfigDataSourceListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userConfigDataSourceList, 'UserConfigDataSourceList', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.productCode)) {
    body['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.userConfigDataSourceListShrink)) {
    body['UserConfigDataSourceList'] = request.userConfigDataSourceListShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SaveDataSourceOrderConfig',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 保存用户的信源配置
 *
 * @param request SaveDataSourceOrderConfigRequest
 * @return SaveDataSourceOrderConfigResponse
 */
async function saveDataSourceOrderConfig(request: SaveDataSourceOrderConfigRequest): SaveDataSourceOrderConfigResponse {
  var runtime = new $RuntimeOptions{};
  return saveDataSourceOrderConfigWithOptions(request, runtime);
}

model SaveMaterialDocumentRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
  author?: string(name='Author'),
  bothSavePrivateAndShare?: boolean(name='BothSavePrivateAndShare', example='false'),
  docKeywords?: [ string ](name='DocKeywords'),
  docType?: string(name='DocType', description='This parameter is required.', example='excel'),
  externalUrl?: string(name='ExternalUrl', example='http://xxxxx/xxx'),
  htmlContent?: string(name='HtmlContent'),
  pubTime?: string(name='PubTime', example='2023-04-11 06:14:07'),
  shareAttr?: int32(name='ShareAttr', example='1'),
  srcFrom?: string(name='SrcFrom', example='IntellijSearch'),
  summary?: string(name='Summary'),
  textContent?: string(name='TextContent'),
  title?: string(name='Title'),
  url?: string(name='Url', example='http://xxxxx/xxx'),
}

model SaveMaterialDocumentShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='c160c841c8e54295bf2f441432785944_p_efm'),
  author?: string(name='Author'),
  bothSavePrivateAndShare?: boolean(name='BothSavePrivateAndShare', example='false'),
  docKeywordsShrink?: string(name='DocKeywords'),
  docType?: string(name='DocType', description='This parameter is required.', example='excel'),
  externalUrl?: string(name='ExternalUrl', example='http://xxxxx/xxx'),
  htmlContent?: string(name='HtmlContent'),
  pubTime?: string(name='PubTime', example='2023-04-11 06:14:07'),
  shareAttr?: int32(name='ShareAttr', example='1'),
  srcFrom?: string(name='SrcFrom', example='IntellijSearch'),
  summary?: string(name='Summary'),
  textContent?: string(name='TextContent'),
  title?: string(name='Title'),
  url?: string(name='Url', example='http://xxxxx/xxx'),
}

model SaveMaterialDocumentResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  data?: long(name='Data', example='12'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='数据不存在'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='false'),
}

model SaveMaterialDocumentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveMaterialDocumentResponseBody(name='body'),
}

/**
 * @summary 保存素材
 *
 * @param tmpReq SaveMaterialDocumentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SaveMaterialDocumentResponse
 */
async function saveMaterialDocumentWithOptions(tmpReq: SaveMaterialDocumentRequest, runtime: $RuntimeOptions): SaveMaterialDocumentResponse {
  tmpReq.validate();
  var request = new SaveMaterialDocumentShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.docKeywords)) {
    request.docKeywordsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.docKeywords, 'DocKeywords', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.author)) {
    body['Author'] = request.author;
  }
  if (!$isNull(request.bothSavePrivateAndShare)) {
    body['BothSavePrivateAndShare'] = request.bothSavePrivateAndShare;
  }
  if (!$isNull(request.docKeywordsShrink)) {
    body['DocKeywords'] = request.docKeywordsShrink;
  }
  if (!$isNull(request.docType)) {
    body['DocType'] = request.docType;
  }
  if (!$isNull(request.externalUrl)) {
    body['ExternalUrl'] = request.externalUrl;
  }
  if (!$isNull(request.htmlContent)) {
    body['HtmlContent'] = request.htmlContent;
  }
  if (!$isNull(request.pubTime)) {
    body['PubTime'] = request.pubTime;
  }
  if (!$isNull(request.shareAttr)) {
    body['ShareAttr'] = request.shareAttr;
  }
  if (!$isNull(request.srcFrom)) {
    body['SrcFrom'] = request.srcFrom;
  }
  if (!$isNull(request.summary)) {
    body['Summary'] = request.summary;
  }
  if (!$isNull(request.textContent)) {
    body['TextContent'] = request.textContent;
  }
  if (!$isNull(request.title)) {
    body['Title'] = request.title;
  }
  if (!$isNull(request.url)) {
    body['Url'] = request.url;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SaveMaterialDocument',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 保存素材
 *
 * @param request SaveMaterialDocumentRequest
 * @return SaveMaterialDocumentResponse
 */
async function saveMaterialDocument(request: SaveMaterialDocumentRequest): SaveMaterialDocumentResponse {
  var runtime = new $RuntimeOptions{};
  return saveMaterialDocumentWithOptions(request, runtime);
}

model SaveStyleLearningResultRequest {
  agentKey?: string(name='AgentKey', example='xxxxx_p_efm'),
  aigcResult?: string(name='AigcResult'),
  customTextIdList?: [ long ](name='CustomTextIdList'),
  materialIdList?: [ long ](name='MaterialIdList'),
  rewriteResult?: string(name='RewriteResult'),
  styleName?: string(name='StyleName'),
  taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model SaveStyleLearningResultShrinkRequest {
  agentKey?: string(name='AgentKey', example='xxxxx_p_efm'),
  aigcResult?: string(name='AigcResult'),
  customTextIdListShrink?: string(name='CustomTextIdList'),
  materialIdListShrink?: string(name='MaterialIdList'),
  rewriteResult?: string(name='RewriteResult'),
  styleName?: string(name='StyleName'),
  taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
}

model SaveStyleLearningResultResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: boolean(name='Data', example='true'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model SaveStyleLearningResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveStyleLearningResultResponseBody(name='body'),
}

/**
 * @summary 保存自定义文体
 *
 * @param tmpReq SaveStyleLearningResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SaveStyleLearningResultResponse
 */
async function saveStyleLearningResultWithOptions(tmpReq: SaveStyleLearningResultRequest, runtime: $RuntimeOptions): SaveStyleLearningResultResponse {
  tmpReq.validate();
  var request = new SaveStyleLearningResultShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.customTextIdList)) {
    request.customTextIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.customTextIdList, 'CustomTextIdList', 'json');
  }
  if (!$isNull(tmpReq.materialIdList)) {
    request.materialIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.materialIdList, 'MaterialIdList', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.agentKey)) {
    body['AgentKey'] = request.agentKey;
  }
  if (!$isNull(request.aigcResult)) {
    body['AigcResult'] = request.aigcResult;
  }
  if (!$isNull(request.customTextIdListShrink)) {
    body['CustomTextIdList'] = request.customTextIdListShrink;
  }
  if (!$isNull(request.materialIdListShrink)) {
    body['MaterialIdList'] = request.materialIdListShrink;
  }
  if (!$isNull(request.rewriteResult)) {
    body['RewriteResult'] = request.rewriteResult;
  }
  if (!$isNull(request.styleName)) {
    body['StyleName'] = request.styleName;
  }
  if (!$isNull(request.taskId)) {
    body['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SaveStyleLearningResult',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 保存自定义文体
 *
 * @param request SaveStyleLearningResultRequest
 * @return SaveStyleLearningResultResponse
 */
async function saveStyleLearningResult(request: SaveStyleLearningResultRequest): SaveStyleLearningResultResponse {
  var runtime = new $RuntimeOptions{};
  return saveStyleLearningResultWithOptions(request, runtime);
}

model SearchDatasetDocumentsRequest {
  datasetId?: long(name='DatasetId', example='1'),
  datasetName?: string(name='DatasetName', example='数据集名称'),
  extend1?: string(name='Extend1', example='业务参数'),
  includeContent?: boolean(name='IncludeContent', example='false'),
  pageSize?: string(name='PageSize', example='10'),
  query?: string(name='Query', description='This parameter is required.', example='搜索内容'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xx'),
}

model SearchDatasetDocumentsResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    documents?: [ 
      {
        content?: string(name='Content', example='xx'),
        docId?: string(name='DocId', example='用户指定的文档唯一ID'),
        docUuid?: string(name='DocUuid', example='内部文档唯一ID'),
        pubTime?: string(name='PubTime', example='2024-12-09 17:09:40'),
        sourceFrom?: string(name='SourceFrom', example='来源'),
        summary?: string(name='Summary', example='文章摘要'),
        title?: string(name='Title', example='xx'),
        url?: string(name='Url', example='xx'),
      }
    ](name='Documents'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model SearchDatasetDocumentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchDatasetDocumentsResponseBody(name='body'),
}

/**
 * @summary 搜索数据集文档
 *
 * @param request SearchDatasetDocumentsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchDatasetDocumentsResponse
 */
async function searchDatasetDocumentsWithOptions(request: SearchDatasetDocumentsRequest, runtime: $RuntimeOptions): SearchDatasetDocumentsResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!$isNull(request.datasetName)) {
    body['DatasetName'] = request.datasetName;
  }
  if (!$isNull(request.extend1)) {
    body['Extend1'] = request.extend1;
  }
  if (!$isNull(request.includeContent)) {
    body['IncludeContent'] = request.includeContent;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.query)) {
    body['Query'] = request.query;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SearchDatasetDocuments',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 搜索数据集文档
 *
 * @param request SearchDatasetDocumentsRequest
 * @return SearchDatasetDocumentsResponse
 */
async function searchDatasetDocuments(request: SearchDatasetDocumentsRequest): SearchDatasetDocumentsResponse {
  var runtime = new $RuntimeOptions{};
  return searchDatasetDocumentsWithOptions(request, runtime);
}

model SearchNewsRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  filterNotNull?: boolean(name='FilterNotNull', example='false'),
  includeContent?: boolean(name='IncludeContent', example='false'),
  page?: int32(name='Page', example='81'),
  pageSize?: int32(name='PageSize', example='35'),
  query?: string(name='Query', example='检索Query'),
  searchSources?: [ string ](name='SearchSources'),
}

model SearchNewsShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  filterNotNull?: boolean(name='FilterNotNull', example='false'),
  includeContent?: boolean(name='IncludeContent', example='false'),
  page?: int32(name='Page', example='81'),
  pageSize?: int32(name='PageSize', example='35'),
  query?: string(name='Query', example='检索Query'),
  searchSourcesShrink?: string(name='SearchSources'),
}

model SearchNewsResponseBody = {
  code?: string(name='Code', example='NoData'),
  current?: int32(name='Current', example='1'),
  data?: [ 
    {
      author?: string(name='Author', example='作者'),
      content?: string(name='Content', example='文章内容'),
      docUuid?: string(name='DocUuid', example='9a598b44c6444da5907b8ea68a5f82c4'),
      imageUrls?: [ string ](name='ImageUrls'),
      pubTime?: string(name='PubTime', example='2024-01-18 06:46:22'),
      searchSource?: string(name='SearchSource', example='QuarkCommonNews'),
      searchSourceName?: string(name='SearchSourceName', example='夸克检索'),
      source?: string(name='Source', example='央视网'),
      summary?: string(name='Summary', example='文章摘要'),
      tag?: string(name='Tag', example='文章标签'),
      title?: string(name='Title', example='文章标题'),
      updateTime?: string(name='UpdateTime', example='2024-01-18 06:46:22'),
      url?: string(name='Url', example='文章URL'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  size?: int32(name='Size', example='10'),
  success?: boolean(name='Success', example='true'),
  total?: int32(name='Total', example='100'),
}

model SearchNewsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchNewsResponseBody(name='body'),
}

/**
 * @summary 新闻检索
 *
 * @param tmpReq SearchNewsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchNewsResponse
 */
async function searchNewsWithOptions(tmpReq: SearchNewsRequest, runtime: $RuntimeOptions): SearchNewsResponse {
  tmpReq.validate();
  var request = new SearchNewsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.searchSources)) {
    request.searchSourcesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.searchSources, 'SearchSources', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.filterNotNull)) {
    body['FilterNotNull'] = request.filterNotNull;
  }
  if (!$isNull(request.includeContent)) {
    body['IncludeContent'] = request.includeContent;
  }
  if (!$isNull(request.page)) {
    body['Page'] = request.page;
  }
  if (!$isNull(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.query)) {
    body['Query'] = request.query;
  }
  if (!$isNull(request.searchSourcesShrink)) {
    body['SearchSources'] = request.searchSourcesShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SearchNews',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新闻检索
 *
 * @param request SearchNewsRequest
 * @return SearchNewsResponse
 */
async function searchNews(request: SearchNewsRequest): SearchNewsResponse {
  var runtime = new $RuntimeOptions{};
  return searchNewsWithOptions(request, runtime);
}

model SubmitAsyncTaskRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='2daaa2e0c209xb26acb97009ea77bd4b_p_efm'),
  taskCode?: string(name='TaskCode', description='This parameter is required.', example='MaterialDocumentUpload'),
  taskExecuteTime?: string(name='TaskExecuteTime', example='2023-10-14 14:30:00'),
  taskName?: string(name='TaskName', example='任务名称'),
  taskParam?: string(name='TaskParam', example='任务提交参数'),
}

model SubmitAsyncTaskResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  data?: {
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    taskIntermediateResult?: any(name='TaskIntermediateResult', example='{}'),
    taskName?: string(name='TaskName', example='任务名称'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='true'),
}

model SubmitAsyncTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitAsyncTaskResponseBody(name='body'),
}

/**
 * @summary 提交异步任务
 *
 * @param request SubmitAsyncTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitAsyncTaskResponse
 */
async function submitAsyncTaskWithOptions(request: SubmitAsyncTaskRequest, runtime: $RuntimeOptions): SubmitAsyncTaskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.taskCode)) {
    body['TaskCode'] = request.taskCode;
  }
  if (!$isNull(request.taskExecuteTime)) {
    body['TaskExecuteTime'] = request.taskExecuteTime;
  }
  if (!$isNull(request.taskName)) {
    body['TaskName'] = request.taskName;
  }
  if (!$isNull(request.taskParam)) {
    body['TaskParam'] = request.taskParam;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitAsyncTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 提交异步任务
 *
 * @param request SubmitAsyncTaskRequest
 * @return SubmitAsyncTaskResponse
 */
async function submitAsyncTask(request: SubmitAsyncTaskRequest): SubmitAsyncTaskResponse {
  var runtime = new $RuntimeOptions{};
  return submitAsyncTaskWithOptions(request, runtime);
}

model SubmitCustomHotTopicBroadcastJobRequest {
  hotTopicBroadcastConfig?: {
    stepForCustomSummaryStyleConfig?: {
      summaryImageCount?: int32(name='SummaryImageCount', example='3'),
      summaryModel?: string(name='SummaryModel', example='qwen-max'),
      summaryPrompt?: string(name='SummaryPrompt', example='xxxx'),
    }(name='StepForCustomSummaryStyleConfig', description='This parameter is required.'),
    stepForNewsBroadcastContentConfig?: {
      categories?: [ string ](name='Categories', example='["科技","经济","时政","娱乐"]'),
      customHotValueWeights?: [ 
        {
          dimension?: string(name='Dimension', example='views'),
          dimensionName?: string(name='DimensionName', example='维度名称'),
          weight?: int32(name='Weight', example='1'),
        }
      ](name='CustomHotValueWeights'),
      topicCount?: int32(name='TopicCount', example='10'),
    }(name='StepForNewsBroadcastContentConfig', description='This parameter is required.'),
  }(name='HotTopicBroadcastConfig', description='This parameter is required.'),
  hotTopicVersion?: string(name='HotTopicVersion', example='热点版本'),
  topics?: [ string ](name='Topics'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model SubmitCustomHotTopicBroadcastJobShrinkRequest {
  hotTopicBroadcastConfigShrink?: string(name='HotTopicBroadcastConfig', description='This parameter is required.'),
  hotTopicVersion?: string(name='HotTopicVersion', example='热点版本'),
  topicsShrink?: string(name='Topics'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model SubmitCustomHotTopicBroadcastJobResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model SubmitCustomHotTopicBroadcastJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitCustomHotTopicBroadcastJobResponseBody(name='body'),
}

/**
 * @summary 提交自定义播报单任务
 *
 * @param tmpReq SubmitCustomHotTopicBroadcastJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitCustomHotTopicBroadcastJobResponse
 */
async function submitCustomHotTopicBroadcastJobWithOptions(tmpReq: SubmitCustomHotTopicBroadcastJobRequest, runtime: $RuntimeOptions): SubmitCustomHotTopicBroadcastJobResponse {
  tmpReq.validate();
  var request = new SubmitCustomHotTopicBroadcastJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.hotTopicBroadcastConfig)) {
    request.hotTopicBroadcastConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.hotTopicBroadcastConfig, 'HotTopicBroadcastConfig', 'json');
  }
  if (!$isNull(tmpReq.topics)) {
    request.topicsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.topics, 'Topics', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.hotTopicBroadcastConfigShrink)) {
    body['HotTopicBroadcastConfig'] = request.hotTopicBroadcastConfigShrink;
  }
  if (!$isNull(request.hotTopicVersion)) {
    body['HotTopicVersion'] = request.hotTopicVersion;
  }
  if (!$isNull(request.topicsShrink)) {
    body['Topics'] = request.topicsShrink;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitCustomHotTopicBroadcastJob',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 提交自定义播报单任务
 *
 * @param request SubmitCustomHotTopicBroadcastJobRequest
 * @return SubmitCustomHotTopicBroadcastJobResponse
 */
async function submitCustomHotTopicBroadcastJob(request: SubmitCustomHotTopicBroadcastJobRequest): SubmitCustomHotTopicBroadcastJobResponse {
  var runtime = new $RuntimeOptions{};
  return submitCustomHotTopicBroadcastJobWithOptions(request, runtime);
}

model SubmitCustomTopicSelectionPerspectiveAnalysisTaskRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  documents?: [ 
    {
      author?: string(name='Author', example='作者'),
      content?: string(name='Content', description='This parameter is required.', example='文章内容'),
      pubTime?: string(name='PubTime', example='2024-01-22 10:29:00'),
      source?: string(name='Source', example='新浪'),
      summary?: string(name='Summary', example='文章摘要'),
      title?: string(name='Title', example='文章标题'),
      url?: string(name='Url', example='https://www.example.com/aaa.docx'),
    }
  ](name='Documents'),
  prompt?: string(name='Prompt', description='This parameter is required.', example='自定义观点的输入Prompt'),
  topic?: string(name='Topic', example='待分析的主题名（documents与topic二者至少传一个）'),
}

model SubmitCustomTopicSelectionPerspectiveAnalysisTaskShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  documentsShrink?: string(name='Documents'),
  prompt?: string(name='Prompt', description='This parameter is required.', example='自定义观点的输入Prompt'),
  topic?: string(name='Topic', example='待分析的主题名（documents与topic二者至少传一个）'),
}

model SubmitCustomTopicSelectionPerspectiveAnalysisTaskResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model SubmitCustomTopicSelectionPerspectiveAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitCustomTopicSelectionPerspectiveAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 提交自定义热点选题视角分析任务
 *
 * @param tmpReq SubmitCustomTopicSelectionPerspectiveAnalysisTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitCustomTopicSelectionPerspectiveAnalysisTaskResponse
 */
async function submitCustomTopicSelectionPerspectiveAnalysisTaskWithOptions(tmpReq: SubmitCustomTopicSelectionPerspectiveAnalysisTaskRequest, runtime: $RuntimeOptions): SubmitCustomTopicSelectionPerspectiveAnalysisTaskResponse {
  tmpReq.validate();
  var request = new SubmitCustomTopicSelectionPerspectiveAnalysisTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.documents)) {
    request.documentsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.documents, 'Documents', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.documentsShrink)) {
    body['Documents'] = request.documentsShrink;
  }
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitCustomTopicSelectionPerspectiveAnalysisTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 提交自定义热点选题视角分析任务
 *
 * @param request SubmitCustomTopicSelectionPerspectiveAnalysisTaskRequest
 * @return SubmitCustomTopicSelectionPerspectiveAnalysisTaskResponse
 */
async function submitCustomTopicSelectionPerspectiveAnalysisTask(request: SubmitCustomTopicSelectionPerspectiveAnalysisTaskRequest): SubmitCustomTopicSelectionPerspectiveAnalysisTaskResponse {
  var runtime = new $RuntimeOptions{};
  return submitCustomTopicSelectionPerspectiveAnalysisTaskWithOptions(request, runtime);
}

model SubmitDocClusterTaskRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  documents?: [ 
    {
      content?: string(name='Content', description='This parameter is required.', example='文档内容'),
      docId?: string(name='DocId', example='文档ID。用于在返回聚类文章时标识文章。如果文章列表中都不传则使用数组索引作为ID。如果部分传则会报错'),
      title?: string(name='Title', example='文档标题'),
    }
  ](name='Documents', description='This parameter is required.'),
  summaryLength?: int32(name='SummaryLength', example='49'),
  titleLength?: int32(name='TitleLength', example='69'),
  topicCount?: int32(name='TopicCount', example='15'),
}

model SubmitDocClusterTaskShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  documentsShrink?: string(name='Documents', description='This parameter is required.'),
  summaryLength?: int32(name='SummaryLength', example='49'),
  titleLength?: int32(name='TitleLength', example='69'),
  topicCount?: int32(name='TopicCount', example='15'),
}

model SubmitDocClusterTaskResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model SubmitDocClusterTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitDocClusterTaskResponseBody(name='body'),
}

/**
 * @summary 提交文档聚合任务
 *
 * @param tmpReq SubmitDocClusterTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitDocClusterTaskResponse
 */
async function submitDocClusterTaskWithOptions(tmpReq: SubmitDocClusterTaskRequest, runtime: $RuntimeOptions): SubmitDocClusterTaskResponse {
  tmpReq.validate();
  var request = new SubmitDocClusterTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.documents)) {
    request.documentsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.documents, 'Documents', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.documentsShrink)) {
    body['Documents'] = request.documentsShrink;
  }
  if (!$isNull(request.summaryLength)) {
    body['SummaryLength'] = request.summaryLength;
  }
  if (!$isNull(request.titleLength)) {
    body['TitleLength'] = request.titleLength;
  }
  if (!$isNull(request.topicCount)) {
    body['TopicCount'] = request.topicCount;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitDocClusterTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 提交文档聚合任务
 *
 * @param request SubmitDocClusterTaskRequest
 * @return SubmitDocClusterTaskResponse
 */
async function submitDocClusterTask(request: SubmitDocClusterTaskRequest): SubmitDocClusterTaskResponse {
  var runtime = new $RuntimeOptions{};
  return submitDocClusterTaskWithOptions(request, runtime);
}

model SubmitEnterpriseVocAnalysisTaskRequest {
  apiKey?: string(name='ApiKey'),
  contentTags?: [ 
    {
      tagDefinePrompt?: string(name='TagDefinePrompt', example='一级标签-二级标签'),
      tagName?: string(name='TagName', example='一级标签-二级标签'),
      tagTaskType?: string(name='TagTaskType', example='singleTagValue'),
      tagValueDefinePrompt?: string(name='TagValueDefinePrompt'),
    }
  ](name='ContentTags', description='This parameter is required.'),
  contents?: [ 
    {
      extraInfo?: string(name='ExtraInfo'),
      text?: string(name='Text'),
    }
  ](name='Contents'),
  fileKey?: string(name='FileKey', example='oss://default/bucket-name/materialDocument/tenant_agent/fileName'),
  filterTags?: [ 
    {
      tagDefinePrompt?: string(name='TagDefinePrompt', example='一级标签-二级标签'),
      tagName?: string(name='TagName', example='一级标签-二级标签'),
      tagType?: string(name='TagType', example='singleTagValue'),
      tagValueDefinePrompt?: string(name='TagValueDefinePrompt'),
    }
  ](name='FilterTags'),
  materialType?: string(name='MaterialType', example='shortContent'),
  modelId?: string(name='ModelId', description='This parameter is required.', example='qwen-max'),
  positiveSample?: string(name='PositiveSample'),
  positiveSampleFileKey?: string(name='PositiveSampleFileKey', example='oss://default/bucket-name/path/xxx.xlsx'),
  taskType?: string(name='TaskType', example='lightAppSass'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model SubmitEnterpriseVocAnalysisTaskShrinkRequest {
  apiKey?: string(name='ApiKey'),
  contentTagsShrink?: string(name='ContentTags', description='This parameter is required.'),
  contentsShrink?: string(name='Contents'),
  fileKey?: string(name='FileKey', example='oss://default/bucket-name/materialDocument/tenant_agent/fileName'),
  filterTagsShrink?: string(name='FilterTags'),
  materialType?: string(name='MaterialType', example='shortContent'),
  modelId?: string(name='ModelId', description='This parameter is required.', example='qwen-max'),
  positiveSample?: string(name='PositiveSample'),
  positiveSampleFileKey?: string(name='PositiveSampleFileKey', example='oss://default/bucket-name/path/xxx.xlsx'),
  taskType?: string(name='TaskType', example='lightAppSass'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model SubmitEnterpriseVocAnalysisTaskResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    taskId?: string(name='TaskId', example='xxxxx'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model SubmitEnterpriseVocAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitEnterpriseVocAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 提交VOC异步任务
 *
 * @param tmpReq SubmitEnterpriseVocAnalysisTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitEnterpriseVocAnalysisTaskResponse
 */
async function submitEnterpriseVocAnalysisTaskWithOptions(tmpReq: SubmitEnterpriseVocAnalysisTaskRequest, runtime: $RuntimeOptions): SubmitEnterpriseVocAnalysisTaskResponse {
  tmpReq.validate();
  var request = new SubmitEnterpriseVocAnalysisTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.contentTags)) {
    request.contentTagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.contentTags, 'ContentTags', 'json');
  }
  if (!$isNull(tmpReq.contents)) {
    request.contentsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.contents, 'Contents', 'json');
  }
  if (!$isNull(tmpReq.filterTags)) {
    request.filterTagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filterTags, 'FilterTags', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.apiKey)) {
    body['ApiKey'] = request.apiKey;
  }
  if (!$isNull(request.contentTagsShrink)) {
    body['ContentTags'] = request.contentTagsShrink;
  }
  if (!$isNull(request.contentsShrink)) {
    body['Contents'] = request.contentsShrink;
  }
  if (!$isNull(request.fileKey)) {
    body['FileKey'] = request.fileKey;
  }
  if (!$isNull(request.filterTagsShrink)) {
    body['FilterTags'] = request.filterTagsShrink;
  }
  if (!$isNull(request.materialType)) {
    body['MaterialType'] = request.materialType;
  }
  if (!$isNull(request.modelId)) {
    body['ModelId'] = request.modelId;
  }
  if (!$isNull(request.positiveSample)) {
    body['PositiveSample'] = request.positiveSample;
  }
  if (!$isNull(request.positiveSampleFileKey)) {
    body['PositiveSampleFileKey'] = request.positiveSampleFileKey;
  }
  if (!$isNull(request.taskType)) {
    body['TaskType'] = request.taskType;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitEnterpriseVocAnalysisTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 提交VOC异步任务
 *
 * @param request SubmitEnterpriseVocAnalysisTaskRequest
 * @return SubmitEnterpriseVocAnalysisTaskResponse
 */
async function submitEnterpriseVocAnalysisTask(request: SubmitEnterpriseVocAnalysisTaskRequest): SubmitEnterpriseVocAnalysisTaskResponse {
  var runtime = new $RuntimeOptions{};
  return submitEnterpriseVocAnalysisTaskWithOptions(request, runtime);
}

model SubmitSmartClipTaskRequest {
  editingConfig?: {
    backgroundMusicConfig?: {
      style?: string(name='Style'),
      volume?: double(name='Volume', example='0.2'),
    }(name='BackgroundMusicConfig'),
    mediaConfig?: {
      volume?: double(name='Volume'),
    }(name='MediaConfig'),
    speechConfig?: {
      asrConfig?: {
        alignment?: string(name='Alignment'),
        font?: string(name='Font', example='SimSun'),
        fontColor?: string(name='FontColor', example='#ffffff'),
        fontSize?: string(name='FontSize', example='0'),
        spacing?: string(name='Spacing', example='0'),
        x?: float(name='X'),
        y?: float(name='Y'),
      }(name='AsrConfig'),
      speechRate?: double(name='SpeechRate', example='0'),
      style?: string(name='Style'),
      voice?: string(name='Voice'),
      volume?: double(name='Volume', example='0.5'),
    }(name='SpeechConfig'),
    titleConfig?: {
      alignment?: string(name='Alignment', example='TopLeft'),
      timelineIn?: float(name='TimelineIn', example='2'),
      timelineOut?: float(name='TimelineOut', example='3'),
      x?: float(name='X', example='100'),
      y?: float(name='Y', example='100'),
    }(name='TitleConfig'),
  }(name='EditingConfig'),
  extendParam?: string(name='ExtendParam'),
  inputConfig?: {
    backgroundMusics?: [ 
      {
        id?: string(name='Id', description='This parameter is required.', example='oss://default/bucket-name/filepath/video.mp3'),
        type?: string(name='Type', description='This parameter is required.', example='fileKey'),
      }
    ](name='BackgroundMusics'),
    speechTexts?: [ string ](name='SpeechTexts'),
    stickers?: [ 
      {
        height?: double(name='Height', description='This parameter is required.', example='0.5'),
        stickerId?: {
          id?: string(name='Id', description='This parameter is required.', example='oss://default/bucket-name/filepath/sticker.png'),
          type?: string(name='Type', description='This parameter is required.', example='fileKey'),
        }(name='StickerId', description='This parameter is required.'),
        width?: double(name='Width', description='This parameter is required.', example='0.5'),
        x?: double(name='X', description='This parameter is required.', example='0.5'),
        y?: double(name='Y', description='This parameter is required.', example='0.5'),
      }
    ](name='Stickers'),
    titles?: [ string ](name='Titles'),
    videoIds?: [ 
      {
        id?: string(name='Id', description='This parameter is required.', example='oss://default/bucket-name/filepath/video.mp4'),
        type?: string(name='Type', description='This parameter is required.', example='fileKey'),
      }
    ](name='VideoIds', description='This parameter is required.'),
  }(name='InputConfig', description='This parameter is required.'),
  outputConfig?: {
    count?: int32(name='Count', example='1'),
    fileName?: string(name='FileName', example='test_{index}.mp4'),
    height?: int32(name='Height', example='1080'),
    maxDuration?: int32(name='MaxDuration', example='120'),
    saveToGeneratedContent?: boolean(name='SaveToGeneratedContent', example='true'),
    width?: int32(name='Width', example='1920'),
  }(name='OutputConfig'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.'),
}

model SubmitSmartClipTaskShrinkRequest {
  editingConfigShrink?: string(name='EditingConfig'),
  extendParam?: string(name='ExtendParam'),
  inputConfigShrink?: string(name='InputConfig', description='This parameter is required.'),
  outputConfigShrink?: string(name='OutputConfig'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.'),
}

model SubmitSmartClipTaskResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model SubmitSmartClipTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitSmartClipTaskResponseBody(name='body'),
}

/**
 * @summary 提交一键成片剪辑任务
 *
 * @param tmpReq SubmitSmartClipTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitSmartClipTaskResponse
 */
async function submitSmartClipTaskWithOptions(tmpReq: SubmitSmartClipTaskRequest, runtime: $RuntimeOptions): SubmitSmartClipTaskResponse {
  tmpReq.validate();
  var request = new SubmitSmartClipTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.editingConfig)) {
    request.editingConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.editingConfig, 'EditingConfig', 'json');
  }
  if (!$isNull(tmpReq.inputConfig)) {
    request.inputConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.inputConfig, 'InputConfig', 'json');
  }
  if (!$isNull(tmpReq.outputConfig)) {
    request.outputConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.outputConfig, 'OutputConfig', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.editingConfigShrink)) {
    body['EditingConfig'] = request.editingConfigShrink;
  }
  if (!$isNull(request.extendParam)) {
    body['ExtendParam'] = request.extendParam;
  }
  if (!$isNull(request.inputConfigShrink)) {
    body['InputConfig'] = request.inputConfigShrink;
  }
  if (!$isNull(request.outputConfigShrink)) {
    body['OutputConfig'] = request.outputConfigShrink;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitSmartClipTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 提交一键成片剪辑任务
 *
 * @param request SubmitSmartClipTaskRequest
 * @return SubmitSmartClipTaskResponse
 */
async function submitSmartClipTask(request: SubmitSmartClipTaskRequest): SubmitSmartClipTaskResponse {
  var runtime = new $RuntimeOptions{};
  return submitSmartClipTaskWithOptions(request, runtime);
}

model SubmitTopicSelectionPerspectiveAnalysisTaskRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  documents?: [ 
    {
      author?: string(name='Author', example='作者'),
      comments?: [ 
        {
          text?: string(name='Text'),
          username?: string(name='Username'),
        }
      ](name='Comments'),
      content?: string(name='Content', description='This parameter is required.', example='文章内容'),
      pubTime?: string(name='PubTime', example='2024-01-22 10:29:00'),
      source?: string(name='Source', example='新浪'),
      summary?: string(name='Summary', example='文章摘要'),
      title?: string(name='Title', example='文章标题'),
      url?: string(name='Url', example='https://www.example.com/aaa.docx'),
    }
  ](name='Documents'),
  perspectiveTypes?: [ string ](name='PerspectiveTypes', example='TimedViewPoints'),
  topic?: string(name='Topic', example='待分析的主题名（documents与topic二者至少传一个）'),
}

model SubmitTopicSelectionPerspectiveAnalysisTaskShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  documentsShrink?: string(name='Documents'),
  perspectiveTypesShrink?: string(name='PerspectiveTypes', example='TimedViewPoints'),
  topic?: string(name='Topic', example='待分析的主题名（documents与topic二者至少传一个）'),
}

model SubmitTopicSelectionPerspectiveAnalysisTaskResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    taskId?: string(name='TaskId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
    taskName?: string(name='TaskName', example='任务名称'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model SubmitTopicSelectionPerspectiveAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitTopicSelectionPerspectiveAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 提交选题热点分析任务
 *
 * @param tmpReq SubmitTopicSelectionPerspectiveAnalysisTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitTopicSelectionPerspectiveAnalysisTaskResponse
 */
async function submitTopicSelectionPerspectiveAnalysisTaskWithOptions(tmpReq: SubmitTopicSelectionPerspectiveAnalysisTaskRequest, runtime: $RuntimeOptions): SubmitTopicSelectionPerspectiveAnalysisTaskResponse {
  tmpReq.validate();
  var request = new SubmitTopicSelectionPerspectiveAnalysisTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.documents)) {
    request.documentsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.documents, 'Documents', 'json');
  }
  if (!$isNull(tmpReq.perspectiveTypes)) {
    request.perspectiveTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.perspectiveTypes, 'PerspectiveTypes', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.documentsShrink)) {
    body['Documents'] = request.documentsShrink;
  }
  if (!$isNull(request.perspectiveTypesShrink)) {
    body['PerspectiveTypes'] = request.perspectiveTypesShrink;
  }
  if (!$isNull(request.topic)) {
    body['Topic'] = request.topic;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SubmitTopicSelectionPerspectiveAnalysisTask',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 提交选题热点分析任务
 *
 * @param request SubmitTopicSelectionPerspectiveAnalysisTaskRequest
 * @return SubmitTopicSelectionPerspectiveAnalysisTaskResponse
 */
async function submitTopicSelectionPerspectiveAnalysisTask(request: SubmitTopicSelectionPerspectiveAnalysisTaskRequest): SubmitTopicSelectionPerspectiveAnalysisTaskResponse {
  var runtime = new $RuntimeOptions{};
  return submitTopicSelectionPerspectiveAnalysisTaskWithOptions(request, runtime);
}

model UpdateCustomTextRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  commodityCode?: string(name='CommodityCode', example='商品code'),
  content?: string(name='Content', example='内容'),
  id?: long(name='Id', description='This parameter is required.', example='96'),
  title?: string(name='Title', example='标题'),
}

model UpdateCustomTextResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: long(name='Data', example='48'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model UpdateCustomTextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCustomTextResponseBody(name='body'),
}

/**
 * @summary 更新自定义文本
 *
 * @param request UpdateCustomTextRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCustomTextResponse
 */
async function updateCustomTextWithOptions(request: UpdateCustomTextRequest, runtime: $RuntimeOptions): UpdateCustomTextResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.commodityCode)) {
    body['CommodityCode'] = request.commodityCode;
  }
  if (!$isNull(request.content)) {
    body['Content'] = request.content;
  }
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  if (!$isNull(request.title)) {
    body['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateCustomText',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新自定义文本
 *
 * @param request UpdateCustomTextRequest
 * @return UpdateCustomTextResponse
 */
async function updateCustomText(request: UpdateCustomTextRequest): UpdateCustomTextResponse {
  var runtime = new $RuntimeOptions{};
  return updateCustomTextWithOptions(request, runtime);
}

model UpdateDatasetRequest {
  datasetConfig?: {
    searchSourceConfigs?: [ 
      {
        demoQuery?: string(name='DemoQuery', example='可以搜索到的关键词，用来验证是否可用'),
        searchSourceRequestConfig?: {
          body?: string(name='Body', example='{}'),
          connectTimeout?: int32(name='ConnectTimeout', example='3000'),
          headers?: [ 
            {
              name?: string(name='Name', example='参数名称'),
              value?: string(name='Value', example='参数值'),
              valueFormat?: string(name='ValueFormat', example='valueType = time 时有效'),
              valueType?: string(name='ValueType', example='参数值数据类型: 默认string'),
            }
          ](name='Headers'),
          method?: string(name='Method', example='请求方式'),
          params?: [ 
            {
              name?: string(name='Name', example='参数名称'),
              value?: string(name='Value', example='参数值'),
              valueFormat?: string(name='ValueFormat', example='valueType = time 时有效'),
              valueType?: string(name='ValueType', example='参数值数据类型: 默认string'),
            }
          ](name='Params'),
          pathParamsEnable?: boolean(name='PathParamsEnable', example='true'),
          socketTimeout?: int32(name='SocketTimeout', example='3000'),
          url?: string(name='Url', example='api地址'),
        }(name='SearchSourceRequestConfig'),
        searchSourceResponseConfig?: {
          jqNodes?: [ 
            {
              jqNodes?: [ 
                {
                  jqNodes?: [ 
                    {
                      key?: string(name='Key', example='title'),
                      path?: string(name='Path', example='.title'),
                      type?: string(name='Type', example='string'),
                    }
                  ](name='JqNodes'),
                  key?: string(name='Key', example='title'),
                  path?: string(name='Path', example='.title'),
                  type?: string(name='Type', example='string'),
                }
              ](name='JqNodes'),
              key?: string(name='Key', example='节点key'),
              path?: string(name='Path', example='节点路径'),
              type?: string(name='Type', example='节点数据类型：string number list object base'),
            }
          ](name='JqNodes'),
        }(name='SearchSourceResponseConfig'),
        size?: int32(name='Size', example='10'),
      }
    ](name='SearchSourceConfigs'),
  }(name='DatasetConfig'),
  datasetDescription?: string(name='DatasetDescription', example='企业自定义数据集'),
  datasetId?: long(name='DatasetId', example='1'),
  searchDatasetEnable?: int32(name='SearchDatasetEnable', example='3'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model UpdateDatasetShrinkRequest {
  datasetConfigShrink?: string(name='DatasetConfig'),
  datasetDescription?: string(name='DatasetDescription', example='企业自定义数据集'),
  datasetId?: long(name='DatasetId', example='1'),
  searchDatasetEnable?: int32(name='SearchDatasetEnable', example='3'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model UpdateDatasetResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    createTime?: string(name='CreateTime', example='2024-11-12 21:46:24'),
    createUser?: string(name='CreateUser', example='xxx'),
    datasetDescription?: string(name='DatasetDescription', example='xxx'),
    datasetId?: long(name='DatasetId', example='1'),
    datasetName?: string(name='DatasetName', example='xxx'),
    datasetType?: string(name='DatasetType', example='CustomSemanticSearch'),
    newsArticleResults?: [ 
      {
        code?: string(name='Code', example='NoData'),
        current?: int32(name='Current', example='1'),
        data?: [ 
          {
            content?: string(name='Content', example='文章内容'),
            pubTime?: string(name='PubTime', example='2024-11-12 15:12:14'),
            source?: string(name='Source', example='央视网'),
            summary?: string(name='Summary', example='文章摘要'),
            title?: string(name='Title', example='文章标题'),
            url?: string(name='Url', example='https://www.example.com/aaa.docx'),
          }
        ](name='Data'),
        message?: string(name='Message', example='success'),
        size?: int32(name='Size', example='10'),
        total?: int32(name='Total', example='100'),
      }
    ](name='NewsArticleResults'),
    searchDatasetEnable?: int32(name='SearchDatasetEnable', example='1'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model UpdateDatasetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDatasetResponseBody(name='body'),
}

/**
 * @summary 数据集管理-更新
 *
 * @param tmpReq UpdateDatasetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDatasetResponse
 */
async function updateDatasetWithOptions(tmpReq: UpdateDatasetRequest, runtime: $RuntimeOptions): UpdateDatasetResponse {
  tmpReq.validate();
  var request = new UpdateDatasetShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.datasetConfig)) {
    request.datasetConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.datasetConfig, 'DatasetConfig', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.datasetConfigShrink)) {
    body['DatasetConfig'] = request.datasetConfigShrink;
  }
  if (!$isNull(request.datasetDescription)) {
    body['DatasetDescription'] = request.datasetDescription;
  }
  if (!$isNull(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!$isNull(request.searchDatasetEnable)) {
    body['SearchDatasetEnable'] = request.searchDatasetEnable;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateDataset',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 数据集管理-更新
 *
 * @param request UpdateDatasetRequest
 * @return UpdateDatasetResponse
 */
async function updateDataset(request: UpdateDatasetRequest): UpdateDatasetResponse {
  var runtime = new $RuntimeOptions{};
  return updateDatasetWithOptions(request, runtime);
}

model UpdateDatasetDocumentRequest {
  datasetId?: long(name='DatasetId', example='1'),
  datasetName?: string(name='DatasetName', example='数据集名称'),
  document?: {
    docId?: string(name='DocId', example='用户指定的文档唯一ID'),
    docUuid?: string(name='DocUuid', example='内部文档唯一ID'),
    title?: string(name='Title', example='xx'),
  }(name='Document', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', example='xxxx'),
}

model UpdateDatasetDocumentShrinkRequest {
  datasetId?: long(name='DatasetId', example='1'),
  datasetName?: string(name='DatasetName', example='数据集名称'),
  documentShrink?: string(name='Document', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', example='xxxx'),
}

model UpdateDatasetDocumentResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    docId?: string(name='DocId', example='用户指定的文档唯一ID'),
    docUuid?: string(name='DocUuid', example='内部文档唯一ID'),
    title?: string(name='Title'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model UpdateDatasetDocumentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDatasetDocumentResponseBody(name='body'),
}

/**
 * @summary 修改数据集文档
 *
 * @param tmpReq UpdateDatasetDocumentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDatasetDocumentResponse
 */
async function updateDatasetDocumentWithOptions(tmpReq: UpdateDatasetDocumentRequest, runtime: $RuntimeOptions): UpdateDatasetDocumentResponse {
  tmpReq.validate();
  var request = new UpdateDatasetDocumentShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.document)) {
    request.documentShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.document, 'Document', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!$isNull(request.datasetName)) {
    body['DatasetName'] = request.datasetName;
  }
  if (!$isNull(request.documentShrink)) {
    body['Document'] = request.documentShrink;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateDatasetDocument',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改数据集文档
 *
 * @param request UpdateDatasetDocumentRequest
 * @return UpdateDatasetDocumentResponse
 */
async function updateDatasetDocument(request: UpdateDatasetDocumentRequest): UpdateDatasetDocumentResponse {
  var runtime = new $RuntimeOptions{};
  return updateDatasetDocumentWithOptions(request, runtime);
}

model UpdateGeneratedContentRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  content?: string(name='Content', example='正文'),
  contentText?: string(name='ContentText', example='正文'),
  id?: long(name='Id', description='This parameter is required.', example='36'),
  keywords?: [ string ](name='Keywords'),
  prompt?: string(name='Prompt', example='创作xx文章'),
  title?: string(name='Title', example='评论类文章'),
}

model UpdateGeneratedContentShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='xxxxx_p_efm'),
  content?: string(name='Content', example='正文'),
  contentText?: string(name='ContentText', example='正文'),
  id?: long(name='Id', description='This parameter is required.', example='36'),
  keywordsShrink?: string(name='Keywords'),
  prompt?: string(name='Prompt', example='创作xx文章'),
  title?: string(name='Title', example='评论类文章'),
}

model UpdateGeneratedContentResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: boolean(name='Data', example='false'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model UpdateGeneratedContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateGeneratedContentResponseBody(name='body'),
}

/**
 * @summary 文档管理-更新。
 *
 * @param tmpReq UpdateGeneratedContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateGeneratedContentResponse
 */
async function updateGeneratedContentWithOptions(tmpReq: UpdateGeneratedContentRequest, runtime: $RuntimeOptions): UpdateGeneratedContentResponse {
  tmpReq.validate();
  var request = new UpdateGeneratedContentShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.keywords)) {
    request.keywordsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.keywords, 'Keywords', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!$isNull(request.content)) {
    body['Content'] = request.content;
  }
  if (!$isNull(request.contentText)) {
    body['ContentText'] = request.contentText;
  }
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  if (!$isNull(request.keywordsShrink)) {
    body['Keywords'] = request.keywordsShrink;
  }
  if (!$isNull(request.prompt)) {
    body['Prompt'] = request.prompt;
  }
  if (!$isNull(request.title)) {
    body['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateGeneratedContent',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档管理-更新。
 *
 * @param request UpdateGeneratedContentRequest
 * @return UpdateGeneratedContentResponse
 */
async function updateGeneratedContent(request: UpdateGeneratedContentRequest): UpdateGeneratedContentResponse {
  var runtime = new $RuntimeOptions{};
  return updateGeneratedContentWithOptions(request, runtime);
}

model UpdateMaterialDocumentRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='67c520d1fa43455ea44fb69fa402d54d_p_beebot_public'),
  author?: string(name='Author'),
  docKeywords?: [ string ](name='DocKeywords'),
  docType?: string(name='DocType', description='This parameter is required.', example='image'),
  externalUrl?: string(name='ExternalUrl', example='http://xxxxx/xxx'),
  htmlContent?: string(name='HtmlContent'),
  id?: long(name='Id', description='This parameter is required.', example='44'),
  pubTime?: string(name='PubTime', example='2023-04-11 06:14:07'),
  regionId?: string(name='RegionId'),
  shareAttr?: int32(name='ShareAttr', example='1'),
  srcFrom?: string(name='SrcFrom', example='UserUpload'),
  summary?: string(name='Summary'),
  textContent?: string(name='TextContent'),
  title?: string(name='Title'),
  url?: string(name='Url', example='http://xxxxx/xxx'),
}

model UpdateMaterialDocumentShrinkRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='67c520d1fa43455ea44fb69fa402d54d_p_beebot_public'),
  author?: string(name='Author'),
  docKeywordsShrink?: string(name='DocKeywords'),
  docType?: string(name='DocType', description='This parameter is required.', example='image'),
  externalUrl?: string(name='ExternalUrl', example='http://xxxxx/xxx'),
  htmlContent?: string(name='HtmlContent'),
  id?: long(name='Id', description='This parameter is required.', example='44'),
  pubTime?: string(name='PubTime', example='2023-04-11 06:14:07'),
  regionId?: string(name='RegionId'),
  shareAttr?: int32(name='ShareAttr', example='1'),
  srcFrom?: string(name='SrcFrom', example='UserUpload'),
  summary?: string(name='Summary'),
  textContent?: string(name='TextContent'),
  title?: string(name='Title'),
  url?: string(name='Url', example='http://xxxxx/xxx'),
}

model UpdateMaterialDocumentResponseBody = {
  code?: string(name='Code', example='DataNotExists'),
  data?: long(name='Data', example='82'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='数据不存在'),
  requestId?: string(name='RequestId', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='false'),
}

model UpdateMaterialDocumentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateMaterialDocumentResponseBody(name='body'),
}

/**
 * @summary 根据ID更新素材
 *
 * @param tmpReq UpdateMaterialDocumentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateMaterialDocumentResponse
 */
async function updateMaterialDocumentWithOptions(tmpReq: UpdateMaterialDocumentRequest, runtime: $RuntimeOptions): UpdateMaterialDocumentResponse {
  tmpReq.validate();
  var request = new UpdateMaterialDocumentShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.docKeywords)) {
    request.docKeywordsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.docKeywords, 'DocKeywords', 'json');
  }
  var query = {};
  if (!$isNull(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  if (!$isNull(request.author)) {
    body['Author'] = request.author;
  }
  if (!$isNull(request.docKeywordsShrink)) {
    body['DocKeywords'] = request.docKeywordsShrink;
  }
  if (!$isNull(request.docType)) {
    body['DocType'] = request.docType;
  }
  if (!$isNull(request.externalUrl)) {
    body['ExternalUrl'] = request.externalUrl;
  }
  if (!$isNull(request.htmlContent)) {
    body['HtmlContent'] = request.htmlContent;
  }
  if (!$isNull(request.id)) {
    body['Id'] = request.id;
  }
  if (!$isNull(request.pubTime)) {
    body['PubTime'] = request.pubTime;
  }
  if (!$isNull(request.shareAttr)) {
    body['ShareAttr'] = request.shareAttr;
  }
  if (!$isNull(request.srcFrom)) {
    body['SrcFrom'] = request.srcFrom;
  }
  if (!$isNull(request.summary)) {
    body['Summary'] = request.summary;
  }
  if (!$isNull(request.textContent)) {
    body['TextContent'] = request.textContent;
  }
  if (!$isNull(request.title)) {
    body['Title'] = request.title;
  }
  if (!$isNull(request.url)) {
    body['Url'] = request.url;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateMaterialDocument',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据ID更新素材
 *
 * @param request UpdateMaterialDocumentRequest
 * @return UpdateMaterialDocumentResponse
 */
async function updateMaterialDocument(request: UpdateMaterialDocumentRequest): UpdateMaterialDocumentResponse {
  var runtime = new $RuntimeOptions{};
  return updateMaterialDocumentWithOptions(request, runtime);
}

model UploadBookRequest {
  categoryId?: string(name='CategoryId'),
  docs?: [ 
    {
      docName?: string(name='DocName'),
      fileUrl?: string(name='FileUrl', example='http://xxx/ccc.pdf'),
    }
  ](name='Docs', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-ipe7d81yq4sl5jmk'),
}

model UploadBookShrinkRequest {
  categoryId?: string(name='CategoryId'),
  docsShrink?: string(name='Docs', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-ipe7d81yq4sl5jmk'),
}

model UploadBookResponseBody = {
  code?: string(name='Code', example='successful'),
  data?: {
    docIds?: [ string ](name='DocIds'),
    existedIds?: [ string ](name='ExistedIds'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='3f7045e099474ba28ceca1b4eb6d6e21'),
  success?: boolean(name='Success', example='true'),
}

model UploadBookResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UploadBookResponseBody(name='body'),
}

/**
 * @summary 妙读上传书籍
 *
 * @param tmpReq UploadBookRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UploadBookResponse
 */
async function uploadBookWithOptions(tmpReq: UploadBookRequest, runtime: $RuntimeOptions): UploadBookResponse {
  tmpReq.validate();
  var request = new UploadBookShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.docs)) {
    request.docsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.docs, 'Docs', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.categoryId)) {
    body['CategoryId'] = request.categoryId;
  }
  if (!$isNull(request.docsShrink)) {
    body['Docs'] = request.docsShrink;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UploadBook',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读上传书籍
 *
 * @param request UploadBookRequest
 * @return UploadBookResponse
 */
async function uploadBook(request: UploadBookRequest): UploadBookResponse {
  var runtime = new $RuntimeOptions{};
  return uploadBookWithOptions(request, runtime);
}

model UploadDocRequest {
  categoryId?: string(name='CategoryId', example='default'),
  docs?: [ 
    {
      docName?: string(name='DocName', description='This parameter is required.'),
      fileUrl?: string(name='FileUrl', description='This parameter is required.', example='http://xxx/ccc.pdf'),
    }
  ](name='Docs', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-yigtrrjl377rcbab'),
}

model UploadDocShrinkRequest {
  categoryId?: string(name='CategoryId', example='default'),
  docsShrink?: string(name='Docs', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='llm-yigtrrjl377rcbab'),
}

model UploadDocResponseBody = {
  code?: string(name='Code', example='successful'),
  data?: {
    docIds?: [ string ](name='DocIds'),
    existedIds?: [ string ](name='ExistedIds'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model UploadDocResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UploadDocResponseBody(name='body'),
}

/**
 * @summary 妙读上传文档接口
 *
 * @param tmpReq UploadDocRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UploadDocResponse
 */
async function uploadDocWithOptions(tmpReq: UploadDocRequest, runtime: $RuntimeOptions): UploadDocResponse {
  tmpReq.validate();
  var request = new UploadDocShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.docs)) {
    request.docsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.docs, 'Docs', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.categoryId)) {
    body['CategoryId'] = request.categoryId;
  }
  if (!$isNull(request.docsShrink)) {
    body['Docs'] = request.docsShrink;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UploadDoc',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 妙读上传文档接口
 *
 * @param request UploadDocRequest
 * @return UploadDocResponse
 */
async function uploadDoc(request: UploadDocRequest): UploadDocResponse {
  var runtime = new $RuntimeOptions{};
  return uploadDocWithOptions(request, runtime);
}

model ValidateUploadTemplateRequest {
  fileKey?: string(name='FileKey', description='This parameter is required.', example='Content'),
  taskType?: string(name='TaskType', example='lightAppSass'),
  templateType?: string(name='TemplateType', description='This parameter is required.', example='Content'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='xxxx'),
}

model ValidateUploadTemplateResponseBody = {
  code?: string(name='Code', example='NoData'),
  data?: {
    commentCount?: int32(name='CommentCount', example='50'),
    dialogueCount?: int32(name='DialogueCount', example='50'),
    totalCount?: int32(name='TotalCount', example='50'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1813ceee-7fe5-41b4-87e5-982a4d18cca5'),
  success?: boolean(name='Success', example='true'),
}

model ValidateUploadTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ValidateUploadTemplateResponseBody(name='body'),
}

/**
 * @summary 校验企业VOC上传模板
 *
 * @param request ValidateUploadTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ValidateUploadTemplateResponse
 */
async function validateUploadTemplateWithOptions(request: ValidateUploadTemplateRequest, runtime: $RuntimeOptions): ValidateUploadTemplateResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.fileKey)) {
    body['FileKey'] = request.fileKey;
  }
  if (!$isNull(request.taskType)) {
    body['TaskType'] = request.taskType;
  }
  if (!$isNull(request.templateType)) {
    body['TemplateType'] = request.templateType;
  }
  if (!$isNull(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ValidateUploadTemplate',
    version = '2023-08-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 校验企业VOC上传模板
 *
 * @param request ValidateUploadTemplateRequest
 * @return ValidateUploadTemplateResponse
 */
async function validateUploadTemplate(request: ValidateUploadTemplateRequest): ValidateUploadTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return validateUploadTemplateWithOptions(request, runtime);
}

